Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Score of 7
0 answers
149 views

Recently I learnt that nearly every C++-hello-world-program is buggy because it returns 0 (= EXIT_SUCCESS) even if the output could not be written. This can e. g. happen when you redirect the output ...
Score of 3
1 answer
202 views

Clang has the warning unqualified-std-cast-call. It warns when move and forward are used without the std:: qualifier, for example when the code has a using statement. The patch says that there is a ...
Score of -4
1 answer
281 views

My C++ compiler (g++ 16) have changed the <simd> library implementation under the hood forcing me to learn the new version of the library. I have got 2 problems: I don't know how to set the ABI ...
Score of 2
2 answers
273 views

I am trying to make an array of 27 non-movable non-copyable objects and then use plain references to them. https://godbolt.org/z/zYhrTxK6c playground with the non-copyable non-movable object Here's ...
Best practices
2 votes
27 replies
525 views

I'm learning about C++ multithreading, and the more I learn about it the more I start to question the design choices of the standard library. Here are some examples: std::thread's inability to simply ...
Advice
0 votes
3 replies
133 views

Lately I've been running into some performance Issues with std's unordered_map, I use it mainly for hash wise lookup, e.g: std::unordered_map<uint64_t, mpark::variant<int32_t, float>> ...
Score of 0
0 answers
272 views

While debugging something I stumbled into this behavior on godbolt. When compiling and running the following (godbolt link https://godbolt.org/z/9c5966sbK): #include <array> int main() { ...
Score of -2
1 answer
217 views

class string { struct long_mode { size_t size; size_t capacity; char* buffer; }; struct short_mode { uint8_t size; char buffer[23]; }; ...
Score of 10
2 answers
406 views

With std::ranges::max, it is possible to use a projection as follows std::vector<std::tuple<char,int,double>> v = { {'a',2,1.0}, {'c',1,3.0}, {'b',4,2.0}, {'d',3,4.0} }; auto m = std::...
Advice
4 votes
22 replies
420 views

Edit: Turns out the issue was an outdated glibc version, both on my computer and in all of the linked Godbolt examples. This issue does not occur with glibc versions >= 2.38 and the various string ...
Advice
1 vote
11 replies
102 views

hope you are doing well guys i just have learnt how to build my own local library or what we call a header (MVS) and i built it within a project and everything was good, but when i have started new ...
Score of 0
0 answers
142 views

I follow How to use module `std` with gcc to generate "gcm.cache/std.gcm" on Windows using GCC 15.2.0 and ran g++ -std=c++23 -fmodules -fsearch-include-path -c bits/std.cc at "C:\bak\...
Score of 4
3 answers
358 views

I have a struct that contains a std::atomic member: #include <atomic> #include <cstdint> struct Foo { std::atomic<int64_t> value; int64_t age; }; If I allocate memory for ...
Score of 2
1 answer
369 views

Is std::system thread safe? If not, in which way? Clangd gives me warning about it, says this function is not thread safe. If not, I want to execute different task in a thread safe way, is there a ...
Score of 4
2 answers
417 views

Recently I've decided to "modularize" my library. No success. Here is the repo where you can find CMakeLists.txt & CMakePresets.json: kissra (GitHub) The issue is that CMake cannot find ...

15 30 50 per page
1
2 3 4 5
415