Category "c++"

Problem: Assigning a group number to elements near eachother where groups are separated from spaces

We have a room divided of 6x5 possible seats, every place in the 6x5 matrix could be a seat or could be empty. We have the Matrix with all the seats already ass

How to run my analysis pass on optimized ir

I write a driver to run pass in my code. void MyPassManager::addNewFuncPassByCode(string PassCode, FunctionPassManag

Are there any good mappings between GCC and MSVC warnings? E.g. -Wredundant-move on MSVC

This question is somewhat two fold, one being more general than the other. The specific question is; does MSVC have equivalent warnings to -Wredundant-move? Mor

Custom distance with FLANN in OpenCV

Is there a way to define our own distance for FLANN tool in OpenCV. This question has been asked here but remains not answered for more than 6 years.

Template of multiple abstract classes

There are many questions about template specialization with abstract classes, still I couldn't find something that helped me solve my problem. First of all, let

ld: fatal: file bcPACplacebo.o: wrong ELF class: ELFCLASS32

Below are my environments that I am running my project which has C and CPP codes. uname -a: SunOS nzdrb12z 5.11 11.4.40.107.3 sun4v sparc sun4v non-global-zone

Install IPOPT locally into C++ codebase with CMake ExternalProject

I would like to use Ipopt in a CMake-based project using ExternalProject. The library should be installed locally and automatically in the build folder so that

Add a library in Android.mk

I don't now how many time I try to add a library in my Android.mk, but nothing work. My Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MO

Eigen3 library with C++20 format

I am trying to print Eigen::Array or Eigen::Matrix with c++20 format, instead of Eigen::IOFormat. I would like to control the precision and alignment of element

Leetcode C++ error: reference to non-static member function must be called

when I was doing Leetcode, I wrote my codes as follows: class Solution { public: bool compare(vector<int> a, vector<int> b) { return

How does os figure if a dll is already loaded in memory or how does os figure two dll are the same?

In my comprehension, "dll/so" can be shared between programs(processes). for example when "libprint.so" is loaded in "main"(called main1) at first time, "libpri

Is Q_INTERFACES macro needed for child classes?

If I have class A that implements an interface (and uses Q_INTERFACES macro), then does child class B : public A also need to use the Q_INTERFACES macro? For ex

How can I *directly* append to a QVariantList, stored in a QVariantMap?

I have a collection of QVariantMaps which contains QVariantLists in SOME of their entries. I need to append to the lists. These lists can grow rather large, an

Using QSGTexture/QSGMaterial and Qt's RHI to implement a custom texture format for shaders

With Qt 6.2 there is a whole system of "graphics API independent" infrastructure (both on tooling and on C++ side) that enables you to render things in e.g. QML

Returning a struct pointer from class method

EDIT: Changed example code to code from my project that doesn't work. I'm writing code in C++, learning templates and got stuck with some problem. There's a cla

Where a const reference refers to? [duplicate]

There is a simple program #include <stdio.h> int counter = 3; const int& f() { return counter++; } const int& g() { r

Enter is converted to gibberish code after system()

When I use C++ to invoke Python program output (By system command with parameters), it outputs gibberish code at the end of line. After that, I couldn't input a

Zip directory recursion

I am working on creating zip archive using old Qt - ZipWriter class. The problem is when I want to add the directory. The default Qt code for addDirectory metho

Checking the last accessed files on Windows 10 in C++

I'm writing a small tool to help my workflow as an artist, and it'd be neat if it could check a list of recently accessed files on my computer for a *.psd (phot

Returning MIME data from a function in Qt

I am trying to create a class with drag and drop. I want it to be used as a base class for future derived classes. I want derived classes to specify MIME data f