Skip to main content
-1 votes
0 answers
84 views

I am developing a C++ application using gtkmm-3.0 on root@colibri-imx6ull-15625953:~# cat /etc/os-release ID=tdx-x11 NAME="TDX X11" VERSION="5.7.1-devel-20221213120311+build.0 (dunfell)&...
Chetan D M's user avatar
Advice
0 votes
11 replies
149 views

I want to know how this concept can be implemented in C++ with recursion: My program was running fine before, but when I try to implement negative exponent handling, it is giving me a Segmentation ...
Wasthisit's user avatar
Advice
0 votes
8 replies
146 views

I am asked to implement: int maxVal(const vector& arr, int i = 0) Using recursion only, no loops. I have the idea that I have to compare each element, but I'm confused how this idea should be ...
Wasthisit's user avatar
0 votes
0 answers
79 views

In the following C++ code (compiled with g++ 10.2.0), the declaration of myManager_not_ok produces the error: error: deduced class type ‘Manager’ in function return type while the other, quasi-...
LostInCompilation's user avatar
-2 votes
0 answers
147 views

std::cout stores values in a buffer and then prints them to the console. I have this example: #include <iostream> int main() { for(int i=0;i<10000;i++) std::cout << "A&...
Tushar's user avatar
  • 105
Advice
0 votes
13 replies
118 views

I have the following directory structure for a C++ project: external eigen-5.0.1 Eigen source <source files> When compiling, I add both external/eigen-5.0.1 and source to the -...
josh_eime's user avatar
  • 308
5 votes
1 answer
210 views

With Howard Hinnant's date.h (I am using C++17), how can I get Monday's date and Friday's date using the library? I can get today's date using this: auto todayDate = date::floor<date::days>(std::...
segmentation_fault's user avatar
4 votes
1 answer
205 views

#include <string_view> #include <iostream> int main() { std::string_view sv = std::string("Hello") + " World"; std::cout << sv << std::endl; } C++...
Spook's user avatar
  • 87
Best practices
0 votes
12 replies
192 views

We have a service that when sending messages to us, includes a uint8_t error code. With several hundred possible codes. In our application, we translate this into about 8 categories of errors in an ...
Chuu's user avatar
  • 4,601
Advice
0 votes
6 replies
148 views

I created a template function tostr(...) that is able to convert a lot of types to string with several options. Example of possible code: std::vector<double> x = {1.123456789, 9.987654321}; std::...
Caduchon's user avatar
  • 5,288
-1 votes
3 answers
308 views

I am trying to overload operator<< for a C-style array passed by reference to a function, like this: #include <cstdint> #include <iostream> #include <algorithm> #include <...
vazlsky's user avatar
  • 2,386
4 votes
1 answer
124 views

I'm writing a 2D game engine in SDL3 and C++ and I'm trying to serialize my node trees with cereal (https://uscilab.github.io/cereal/). Every node can have a list of components, and I'm having ...
slashed's user avatar
  • 61
3 votes
2 answers
158 views

Given ViewPath is a class which takes a void function pointer and a varying number of std::variant<std::string, int> as arguments in its constructor. Given the arguments of said function pointer ...
Existn't's user avatar
  • 173
2 votes
3 answers
200 views

I want to run a member function with arguments defined by a tuple. The tuple itself gets its types from the template. I have looked at answers such as https://stackoverflow.com/a/69694086/18658154, ...
Existn't's user avatar
  • 173
4 votes
0 answers
103 views

This code prints: 1 when compiled with g++ v15.2.1, 0 when compiled with clang++, v21.1.6. The -std=c++17 flag is used with both compilers. #include <iostream> #include <type_traits> #...
Rudolf Lovrenčić's user avatar

15 30 50 per page
1
2 3 4 5
762