Category "c++"

Concise RAII for Trompeloeil mocks

I have classes like this: /* "Things" can be "zarked", but only when opened, and they must be closed afterwards */ class ThingInterface { public: // Open the

Compilation error C2048 while compiling in visual studio 2019 MSVC, but works fine with clang++?

I tried to compile the following sample code with clang compiler and it works fine. Compiler Details: Apple clang version 12.0.0 (clang-1200.0.32.28) Target: x

Implementation of scipy.signla.filtfilt in c++? [closed]

I am trying to implement scipy.signal.filtfilt function in c++ and I am wondering if there is already an implementation available of this?

Lvalue-to-rvalue conversion for class types: is there copying involved?

(I asked this question before but didn't give a viable example so I deleted previous one. I hope on this one I got the example right.) Case: #include <iostre

Pure OpenGL on Windows? [duplicate]

I want to use OpenGL without GLFW, the docs say that I need to add opengl32.lib to linker dependencies. How do I specifically import OpenGL an

What is the meaning of Google Benchmark Iteration?

I am working with Google Benchmark to measure the execution time of some code. For example, I wrote the following code to measure its execution time performance

Find place that causes segmentation fault without IDE

I'm studying one project in C++. It's quite big, build is created with cmake. After installing all dependencies and libs it's the build is done fine. But when I

Performing matrix-operations (e.g. product and inverse) over GF(2^6) in C++

I want to implement some matrix operations such as product and inverse computation over a Galois Field GF(64) in C++ language. I have normally used Eigen libra

Embedding Python in DLL: Access violation reading location when Py_DECREF list object

I am trying to embed Python into an an XLL to allow Python functions to be called within Excel. An XLL is a DLL that also includes at a minimum 2 functions that

C++ Read txt and put each line into Dynamic Array

I am trying to read input.txt file, and trying to put each line into the array as string (later on I will use each element of array in initializing obj that's w

CMake 'undefined reference' error with CERN-ROOT

I'm writing a small addition to CERN ROOT and now can't get rid of 'undefined reference' errors on every function from ROOT that I use (and my classes too). Can

generating all permuated products from a map is not working

My code: #include <bits/stdc++.h> using namespace std; using ll = long long; vector<ll> generate_all(map<ll, int> mp, int keys

Tensorflow Op: how to include libtensorflow_framework.so?

I followed the instructions of this tutorial: https://www.tensorflow.org/extend/adding_an_op#implement_the_gradient_in_python. There is this comment provided: g

FetchContent vs ExternalProject

I am building a project with Cmake and use FetchContent to manage dependencies. For several reasons I cannot depend on system-wide installed packages, so this p

Parsing JSON messages in C++

I am writing an embedded C++ MQTT application which subscribes to topics and receives messages every few seconds. I need to parse the received String message an

Passing unsigned int input attribute to vertex shader

In a typical building of a vertex-array-buffer, I am trying to pass an unsigned int attribute along side other classical ones (vertex, normal, texture coordinat

Passing data from Qdialog to main window in Qt

I am trying to pass data from a Qdialog (Login dialog) to my mainWindow after a successful login and was wondering if it is possible to use Signals and slots to

Linker error: "cannot move location counter backwards (from 200009f8 to 20000800)"

I am trying to build my code for Nucleo STM32F042k6 with PlatformIO firmware Mbed but i get the following error: .pio\build\nucleo_f042k6\STM32F042X6.ld.link_s

How to compress a C++ string using Zstd?

I'm very new to C++ and I wanted to compress a std:string object via Zstd compression library, but so far I couldn't find a C++ sample code for this purpose by

Are there any well performing methods for representing a NA in a array?

Note I'm specifically referring to the term NA and not NaN because I'm not including only number types I've been attempting to represent NA values within arrays