Skip to main content
0 votes
0 answers
90 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\...
Jason's user avatar
  • 1
4 votes
3 answers
299 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 ...
Abhishek's user avatar
  • 293
2 votes
1 answer
320 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 ...
qgi's user avatar
  • 175
4 votes
1 answer
166 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 ...
Dmitry Katkevich's user avatar
6 votes
4 answers
265 views

Let's say I have n arrays (right now I have 4 but that might go up) and they're supposed to be of the same size, but since I'm fetching them from outside the code I want to be sure std::vector<int&...
Nicolas A_Bored_Boy's user avatar
Advice
0 votes
10 replies
254 views

The standard says that after a move, an object is in a "valid but unspecified state". I found nothing in the standard on the properties of being in a "specified state" and being in ...
Norbert's user avatar
  • 103
Advice
3 votes
8 replies
330 views

Off the top of my head, I only remember LLVM's standard library do this, but I remember seeing other libraries also do this. I'm not entirely sure what is the advantage here. I feel like namespace std ...
Somedude's user avatar
Advice
0 votes
6 replies
235 views

I need to layout a structure in two different ways depending on the endianness of the target platform. Currently I'm using an additional pre-compile phase to run a program to test the endianness, and ...
Alnitak's user avatar
  • 341k
-1 votes
1 answer
234 views

I am currently studying the work of the mutex and I have a question, if we have the std::try_lock() method, then why not always use it instead of std::lock(), what are its disadvantages? For example, ...
freakl's user avatar
  • 7
Advice
1 vote
7 replies
186 views

In the question Why does Microsoft's implementation of std::string require 40 bytes on the stack? the observation is made, that a std::string requires 8 additional bytes in Debug mode. After ...
Brandlingo's user avatar
  • 3,252
0 votes
0 answers
88 views

I'm compiling this with VS 2022 C++ compiler, as "ISO C++20 Standard (/std:c++20)" for a Debug configuration. How come this throws the following std::regex_error: regex_error(error_backref):...
c00000fd's user avatar
  • 22.8k
6 votes
4 answers
288 views

Sometimes, it may be useful to build an integral value from a list of bits (in increasing order). Such a function could be named to_integral. Example: static_assert (to_integral(1,1,0,1,0,1) == ...
abcdefg's user avatar
  • 5,207
0 votes
0 answers
118 views

Today I stumbled upon weird behavior of std::is_invocable_r. While doing research for why it is happening, I stumbled upon this question on Stack Overflow: is_invocable_r ignoring the return parameter ...
CygnusX1's user avatar
  • 22.1k
15 votes
1 answer
1k views

According to What are the reasons that extending the std namespace is considered undefined behavior?, adding anything to namespace std is Undefined Behavior, with some exceptions carved out, such as ...
Get rid of LLM slop's user avatar
1 vote
1 answer
606 views

I am trying to use the C++ 23 stacktrace header in my project but I can't get it to compile. I've reproduced this with a minimal case to demonstrate the error I am getting. Any input would be greatly ...
Keegan's user avatar
  • 29

15 30 50 per page
1
2 3 4 5
415