Category "c++"

libxl Library VS Code Setup

I've tried to use libxl library but there is no installation document for vs code even if I try to add header files there is an error message "no such file or d

Using web sockets with C++ and set the object protocol

I'm a complete beginner to all things HTTP and Websockets. I am trying to figure out how to setup a websocket for this specific example: https://docs.automata.t

Is there any way to draw line by it's center in OpenGL?

I'm making a class that draws axis for a graph. And the result should look like this: And I want to draw lines which represents scale by only passing the coord

Boost async_pipe not showing all child process output

I ran into a roadblock. The code below has issues, but this is just a demo; I want to get the high level logic correct first. The two startup application output

Polymorphic class

In a C++ program in which there is a base class with a virtual function and two derived classes with redefinition of that virtual function , which class is a po

Visual Studio Code C++ Linux Library's On Windows

So basically I am writing a socket program in C++ on a Windows machine. But I am running a WSL and compile the code within the WSL because I am building it for

MPI - Send (unordered) map

I am trying to find a way to send an unordered map from one node to another using MPI. The exact data structure I am trying to send is a nested unordered map (s

Weird file named Ya gets created every startup- I think related to visual studio... What is it and How do I stop this from happening?

Essentially, the title of the post but to be more specific here's an overview of what happens. Every time I start my computer, after I log in a file that window

wxWidgets 3.1.6, wxAuiNotebook Font Problems

I just upgraded to wxWidgets 3.1.6 and it seems there are loads of fixes and upgrades. However, I ran into the problem of rather small font size for notebook pa

Insert an element in a descending sorted array and keep array sorted

Assuming we have a sorted descending vector, like: vector<int> array {26,  21,  13,  11,  8,  3,  2}. I would like to inser

Is waiting for action completion in MQTT async_client necessary?

I am working on an cpp MQTT async_client utilizing the paho library. I am trying to fully understand the workings of the asynchronous client, but I am not sure

Where and why do I have to put the "template" and "typename" keywords?

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway? I have the following code: t

GDB doesn't work: Cannot insert breakpoint 1. Cannot access memory at address [...]

I'm trying to setup my vscode to debug C++ programs using gdb from WSL. But I faced problem with gdb on my WSL 1 (Ubuntu 22.04 LTS). Whenever I try set a breakp

Why {} is better candidate to be int than string for C++ overload resolution? [duplicate]

Overload resolution favours to consider {} as being of some fundamental type as opposed to some container. For example: #include <iostream&

Explanation of C++ FAQ's unsafe macro?

According to the C++ FAQ, macros are evil: [9.5] Why should I use inline functions instead of plain old #define macros? Because #define macros are ev

Explanation of C++ FAQ's unsafe macro?

According to the C++ FAQ, macros are evil: [9.5] Why should I use inline functions instead of plain old #define macros? Because #define macros are ev

Factory method in C++: why additional Creator interface and does factory method need a class?

I am currently unclear what constitutes the Factory Pattern in C++ given many implementations and examples in the wild. https://refactoring.guru/design-patterns

The callstack always shows _errno after strtol in WPA

I'm study WPA. I wrote a simple program and used WPR to collect the etl. My program is very simple, just trying to covert string to int in a loop. #include <

How to assign two or more values to a QMap Variable in Qt

I am getting confused of how to store the values assigned from 3 different functions and storing them in a single map variable QMap<QString,TrainInfo>*Tim

Why conversion from '<brace-enclosed initializer list>' to 'std::tuple<A, bool>' is ambiguous error occurs with GCC 11?

I have the following code #include <tuple> struct A{ int a; int b; }; std::tuple<A,bool> get(){ return {{}, true}; } With GCC 9.* an