Category "c++"

MSVC 2019 and 2022 compiler hangs and is erratic compiling relatively large std::complex arrays in c++17 and c++20

Using the latest C++ MSVC 2019 and 2022 the following code hangs while compiling #include <complex> // const int N = 10000; // about 3 secs // const int N

Save integers from string to vector

I need to save integers from string to vector. Definition of number: each of strings substrings which consists entirely of digits, with a space before the first

Clang compilation into sysroot with newer glibc

I'm trying to compile with a sysroot for Ubuntu 22.04 from a Ubuntu 20.04 image, and I'm having quite a bit of trouble, getting linker errors like these: /usr/b

Why does this two static constexpr int variable behave "differently"?

English is not my first language.Please forgive my syntax mistake. I am new to mutiThread programming, and I am doing a mutiThread Lab about spinLock. A couple

GoogleTest EXPECT_CALL throws uninteresting call warning and returns 0 calls

I am trying to Mock an external library and test what APIs of the library are being called from my interfaces and I have come across a behavior (first time usin

Passing an rvalue to a function

I read a lot of information about rvalue links, I understood everything, but I met this example: template<class T, class Arg> T* make_raw_ptr(Arg &&am

Why am I getting QWindowsWindow::setGeometry: Unable to set geometry warning with Qt 5.12.0

I migrated some code from Qt 5.6.0 to 5.12.0. Suprisingly, I'm getting lots of warnings related to QWindowsWindow::setGeometry. Whenever a dialog is shown on to

Using one loop vs two loops

I was reading this blog :- https://developerinsider.co/why-is-one-loop-so-much-slower-than-two-loops/. And I decided to check it out using C++ and Xcode. So, I

Something in Visual Studio is constantly changing my c++ header Item Type assignments...how to track down the source?

I have a MSVS 2019 C++ project which includes Qt source files that are processed by the Qt moc. In order for my header files (and thus, class declarations) to b

How to delay in c++?

I am working on a rehabilitation application that relies on four ARuco markers,i need to draw on the four markers in the exercise sequence i.e. the object appea

Rationale Behind PCL `shared_ptr` Interfaces

Many PCL interfaces accept only shared_ptr<T> arguments (e.g. boost::shared_ptr< PointCloud>). [Aside: that is it boost::shared_ptr and not std::sha

Can ETL be used with Atmel Studio?

The Embedded Template Library provides the data structures of the STL without using dynamic allocation, to be used in embedded development. I'm experimenting wi

Move an object with a given speed

Here's an example of an if-statement where depending on what keystroke is pressed it will move to a certain position. I have also googled the "move" command in

Printing a message from a base class function through the operator <<

This is the header file with class Rectangle that inherits from class Shape: class Rectangle: public Shape { private: double width; double height;

Running C++ exe file in PowerShell

I'm usually not programming in C++, but this time I had to and I've got a problem executing my code in PowerShell (which I have never done before). The program

How do multiple buffers for attributes work in openGL (ES) shaders and C++ api

I have the proverbial cube sample and have been writing some code to test it all and learn more about shaders. My question is about how multiple buffers are ass

Segmentation fault (core dumped) in image pyramid construction

I am looking at the source code of orb-slam2. I see that the source code of feature extraction written by the author contains a piece of code for building an im

Managing 'Security Settings' in Active Directory GPO using C++

Need help with modify 'Security Settings' in AD's GPO. The 'Administrative template' settings are stored in corresponding ADMX files. I'm able to change these

Mesh getting cut off

I'm using DirectX 11. I'm trying to draw a Cube mesh to the screen but the bottom half is getting cut off. If I move the camera up/down the bottom half is still

How can I propagate const when returning a std::vector<int*> from a const method?

Lets show it in an example where we have a Data class with primary data, some kind of index that points to the primary data, and we also need to expose a const