Category "c++"

QWebEngineView SOCKS5 proxy with authorization

Is there any way to make QWebEngineView work with SOCKS5 with authorization? I tried connecting QWebEnginePage::proxyAuthenticationRequired signal to my slot, b

Why does an optional argument in a template constructor for enable_if help the compiler to deduce the template parameter? [duplicate]

The minimal example is rather short: #include <iostream> #include <array> #include <type_traits> struct Foo{ //template

Installation error OpenCV 4.5.5 from source code in Windows

I was trying to install OpenCV-4.5.5 from source on my windows machine. This machine has the latest Nvidia drivers as well as CUDA 11.6, I did not run into any

Does passing a `unique_ptr` by value have a performance penalty compared to a plain pointer?

Common wisdom is that std::unique_ptr does not introduce a performance penalty (and not a memory penalty when not using a deleter parameter), but I recently stu

Gazebo how can i change model weigth during runtime?

I want to decrease model weigth in runtime. I am currently working on a plugin but it doesn't seem to work. I am using iris model with pixhawk 4 sitl. My purpos

asio::thread created in object with global scope causes strange behavior, but not if it is created in main

I have been battling a problem for a day or so and "solved" it but I wonder if anyone knows why it must be so, or whether I have just hacked my way around a dee

Covariant return type on Eigen Matrix for base class method

Suppose that I have two different solvers that both will be called at run time. I want to call solvers' api and get resulted Eigen matrix through the base class

QProcess does not signal stdout ready

When I launch xfreerdp process out of shell, it prints INFO messages to stdout and WARN/ERROR messages to stderr, as expected (this is just the default /log-lev

Conditional jump or move depends on uninitialised value(s) after getline

EDIT: I found the issue, the call of the function was a problem. Item item = readItem(bookFile, world, item); This is my code. Valgrind shows: Conditional jump

Template issue with nlohmann::json

Here's my code and the error, and below I'll show some code that works. #include <iostream> #include <string> #include <nlohmann/json.hpp> u

VS code c++: "exited with code=3221225785"

I'm a complete novice to VS code, and I've only been coding with C++ for around a month. I tried this bare bones program to make sure things were set up correct

Multi-threaded input processing

I am new to using multithreading and I am working on a program that handles mouse movement, it consists of two threads, the main thread gets the input and store

Matrix multiplication by rearranging

I have a list of matrix dimensions like: (1, 2), (3, 2), (2, 3), (3, 1) I want to rearrange the matrix dimensions so that all of them can be multiplied. For the

Cython: Assign pointer values, not the pointer itself

C/C++ allows assigning values of a pointer to another pointer of the same type: #include <iostream> using namespace std; int main() { int* a = new i

why f.seekp(f.tellg()) cannot run?

I want to finish a program which can find a string in a file and then output a char 'T' in the end of line which the string exists . And my code like below(in t

What is a glibc free/malloc/realloc invalid next size/invalid pointer error and how to fix it?

You are most likely seeing this question because your question has been closed as a duplicate of this. For a moderately complete list of related questions, ple

Access pixel value of mask using opencv

I got a problem where I need to access pixels of a opencv Mat image container. I use opencv inRange function to create a mask. In that mask I need to check the

How can i link an external function to another static library?

I am programming two static libraries with extern functions in C++. In my first library I have this line of code: EntryPoint.hpp: extern Application* createAppl

How to get the key of a map using the value in C++ STL

Get key by inputting the value of that key in C++ STL map<int,int> m; m[0]=8; m[8]=7; m[1562]=4; m[100]=1; auto i=m.find(1562); cout<

Creating Static Meshes in For Loop using C++ with unreal engine

this is the fix at top use this to create a string that Static Mesh Object can accept as a unique identifier so the engine doesn't crash FName name = *FString::