Category "c++"

What do the values of the C++ "feature test macros" mean?

To test for a feature, cppreference mentions these feature test macros: link. If the feature is present in the compiler, the macro is defined. But I don't unde

Only clang-cl is supported on Windows when building project with webrtc

I am trying to build a project that contains webrtc. However compilation fails with this error : vendor\webrtc\src\base/compiler_specific.h(11,1): fatal error C

Cache-friendliness std::list vs std::vector

With CPU caches becoming better and better std::vector usually outperforms std::list even when it comes to testing the strengths of a std::list. For this reason

Arduino servo code resetting to positon 0

(excuse my english) Hi. I'm a beginner at coding who started trying things in Arduino and c++ (because of Arduino). Recently I just learned that you could write

How to disable a particular CustomAction for previously installed version during an upgrade installation with MSI database?

I have a package whose previously installed versions contain a series of poorly designed custom actions: they do stuff that can be done out of the box. Thus I'm

Is std::condition_variable::notify_one reentrant?

Can I safely execute following code? Is it possible to have deadlock here or some unexpected behaviour, especially when SIGINT arrives? #include <atomic>

Hazelcast Client Imap issues while using get() function - C++

Is there a way to know the data type before of a hazelcat key before getting the key in Hazelcast 5.0 or later versions? Specifically, my C++ code is: hazelcast

Advantage of using trailing return type in C++11 functions

What is the advantage of specifying a trailing return type in C++11, as opposed to a normal return type? Look at foo1 vs foo2 here: int foo1() { return 1;

Can a non-virtual function be equal to 0?

Can a non-virtual function be equal to 0, e.g., something like void foo() = 0 where the keyword virtual is not in front?

Creating a HTTPS request using Boost Asio and OpenSSL

I have created a simple HTTP request wherein I am sending GET,POST and PUT requests to the server. Next I want to switch to HTTPS connection using boost asio li

Is it possible to flatten an Eigen matrix without copying?

Suppose you have a matrix A: 1 2 3 4 There are two flattenings: 1 2 3 4 and 1 3 2 4 If the default (ColMajor) storage type is used, we can get the latt

How to collapse Gtkmm notebook tabs?

So I am making a Gtkmm application using a Gtk::notebook and during run-time I'm adding new tabs to the notebook. But when I add more tabs than there is space o

Compiling c++ OpenACC parallel CPU code using GCC (G++)

When trying to compile OpenACC code with GCC-9.3.0 (g++) configured with --enable-languages=c,c++,lto --disable-multilib the following code does not use multipl

How to install and use just Clang-Format on Fedora 27?

I'm trying to figure out how to install the stand alone Clang-Format tool. I've downloaded the pre build binaries for Clang from the official download page for

Would the compiler optimize this for loop?

In C or C++, if the compiler encounters a for loop in which a counter is counting from 0 to n, and n is a variable (not a function call, and NOT A CONSTANT eith

Why does my application use more memory on Windows 10?

I have a C++ application compiled with Visual Studio 2010. This is a large legacy application with multiple threads servicing sockets, database connections, RV

SDL_image failing to initialise

When I try and initialise IMG or use IMG_Load, I get the error: "IMG_Init: Failed loading libpng16-16.dll: The specified module could not be found." From what I

load/save multiple images from/in a directory - opencv c++

i want to load a lot of images (not sequential names though) from a directory. edit them and then save them in a different directory with their original names i

do sequentially-consistent atomic loads (load-load pair) form an inter-thread synchronisation point?

I am trying to understand what does sequentially-consistent ordering mean for loads. Consider this artificial example: #include <atomic> #include <thr

What is the purpose of std::launder?

P0137 introduces the function template std::launder and makes many, many changes to the standard in the sections concerning unions, lifetime, and pointers. Wh