Category "c++"

How do I insert customType array data in QDBusArgument

I am trying to set and get DNS using QtDBusInterface. As per the documentation, it has "a(iay)" format. which contains an array of IP types and an array of unsi

How can I call functions from one .cpp file in another .cpp file?

I tried looking this up and got mixed results using header files and such. Basically I have multiple .cpp files with all my functions I made for use with binary

Private Data in VMMap is very large on some machines

I'm trying to debug a memory exhaustion issue for my native Win32 CPP app, so far i have found that on some machine when launched, app the memory usage is very

qualified-id in declaration before '(' token

This is some crazy error and is giving me a lot of trouble. #include <iostream> using namespace std; class Book { private: int bookid; char

Is it possible to popcount __m256i and store result in 8 32-bit words instead of the 4 64-bit using Wojciech Mula algorithm's?

I have recently discovered that AVX2 doesn't have a popcount for __m256i and the only way I found to do something similar is to follow the Wojciech Mula algori

Why I am getting different output in every run in openmp

I have N number of text files. I am trying to read from those files parallelly, so I have forked N threads and each thread gets one text file from those N files

Function to parse automaticly files .txt after 24 hour in c++

I have a project and I'm new to C++ Well I have to parse a file.txt that contains transaction informations in an ATM. And there is files named as the date of th

Are accents and special characters broken in Qt6?

I've got a Qt program that reads from csv files and saves the info into a database. There was no problem until i tried to update from Qt 5.15.2 to Qt 6.3. Now,

Wrapper for std::vector that makes Structure of Arrays look like Array of Structures

I have a vector of a struct with 8 different fields (integers and pointers) that serves as a database for my program. Usually only a few of these fields are act

Visual Studio Code c++11 extension warning

I am in the process of learning c++ and I'm using visual studio code for Mac. I use Code Runner to run my program. My problem is that when I use something from

Visual Studio Emulator is Offline Not Launching C++ Mobile

You might let me explain my little issue. I switched from android studio to visual studio for mobile c++ developing. I installed VS (visual studio) and also an

Using optimistic locks in C++ and memory order

I'm wondering how 'optimistic locks' (as described e.g. here: https://db.in.tum.de/~leis/papers/artsync.pdf) can be used in C++ with regard to non-atomic data a

Fastes way to read a tsv file and store it in a map (C++)

I'm working on a project with 6 huge mapping tsv files. In most cases they look like this: First: ID which is a unique String which starts with a char and goes

Count of combinations with repetitions

I have a very inefficient way of counting the combinations of N/2 items from an array of size N. What I do is sort the array to begin with and then loop through

MCU/embedded: Position independent code, max size for .got section?

I am trying to get my project "position independent", but it won't give... Some background: nxp imx rt 1024 evk board c++ project compiled both C and C++ files

Suppressing the inline variable warning

Background We are trying to "borrow" some code which uses an inline static variable. The code complies, without any warnings, with a C++17 compiler. However w

Is constrained auto cast valid?

Since C++20, the constrained auto is introduced by: Concept auto identifier = init Which means, for instance: std::integral auto x = 10; is valid. Also, for n

Efficiently shift-or large bit vector

I have large in-memory array as some pointer uint64_t * arr (plus size), which represents plain bits. I need to very efficiently (most performant/fast) shift th

qt add a database sql into a project imported from cmake

Normally, to add a database to qt, we would go to the .pro file and add sql, but the project am working on was imported from cmake, so it does not have a .pro f

Why can I partially specialize but can't fully specialize member templates in C++?

IMO, C++ template rules seem too restrictive and compiler implementation defined. But here I have a specific behavior I've had a hard time wrapping my head arou