502 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
146
views
Quadratic behaviour examples generating of libc++ sort implementation
I'm studying sorting algorithms at the moment and I have one question that is actually quite well-known but still I can't find a full answer that is comprehensive enough for me. So, the topic is libc++...
3
votes
1
answer
187
views
Size of the state table in std::atomic wait implementation
While looking through implementations of the std::atomic<T>::wait, I've found that most of them used a simple hash table for mapping the state for each atomic location.
libcxx
static constexpr ...
1
vote
1
answer
109
views
Is [[__no_unique_address__]] applied to second members in this tail padding optimization check in libc++ redundant?
In the libc++ implementation of std::expected, there is this helper variable template:
// This function returns whether the type `_Second` can be stuffed into the tail padding
// of the `_First` type ...
1
vote
0
answers
67
views
Reproducing a libc++ optimisation that uses tail padding to store field members with no additional space [duplicate]
I've been reading the implementation of std::expected in libc++, and it describes an interesting optimisation where it stores a bool discriminator in the tail padding of the value/error types, when ...
3
votes
2
answers
139
views
May the compiler add extra defaulted template parameters to the std templates?
Consider the following code:
#include <memory>
class A {
protected:
~A() = default;
friend void std::destroy_at<A>(A*); // libstdc++ ok, but libc++ failed.
public:
void f() {...
1
vote
1
answer
65
views
Compiling C++ sources for PLC based on Linux RT (Arm Cortex A8)
I'm a full beginner in Linux.
I need to program some PLC (ADAM 5630 of Advantech). It is based on the CPU TI Cortex A8 and has Linux RT 3.12 (Linux adam5630 3.12.10-rt15-ti2013.12.01; Distributor: ...
-2
votes
1
answer
352
views
can't find libc++ packages on el9
I have a c++ application that I automatically build and release for various platforms. I use docker images to build for Linux distros.
Recently I ran into a libstdc++ bug in std::regex (very old, ...
1
vote
1
answer
85
views
Why is libc++ not a dynamic executable like libstdc++?
I stumbled across this when building clang and gcc from source. libstdc++ seems to be dynamically linked while libc++ is not. Why is this the case? Does it mean libc++ has glibc and glib statically ...
0
votes
0
answers
42
views
How to check if an iterator is a wrap_iter type? [duplicate]
In libc++, there are several places where a pointer is passed as a wrap_iter. I want to write a function that needs to check if an iterator is a wrap_iter type, eg:
template<class T, class Iter, ...
7
votes
0
answers
309
views
What is the purpose/semantics of P2786 is_replaceable?
The C++ working draft now has [EDIT: as of November 2025 it's removed again! But I'll leave this question open until 2026-ish just for historical interest] a definition of replaceable type (...
0
votes
0
answers
113
views
In C++ standard library implementation, why some definition is put into dynamic library like '__shared_weak_count::__release_weak`?
When reading the implementation for std::shared_ptr in llvm libc++, I find that some member functions of the __shared_weak_count class are put in libcxx/src/memory.cpp, instead of being put into the ...
2
votes
0
answers
342
views
Why is `std::flat_set` not yet implemented while `std::flat_map` is already done in libc++20? [closed]
cppref shows that std::flat_set is not yet implemented while std::flat_map is already done in libc++20.
And, this proposal shows std::flat_set and std::flat_map are both done in libc++ by Arthur O'...
0
votes
0
answers
101
views
Sanitizer crash inside libc++
A little background:
Our team's developers use mostly Macs while the target servers run Ubuntu. After being bitten by subtle compiler/library differences between the platforms, we decided to ...
-1
votes
1
answer
115
views
std::expected in libc++ gives "undefined symbol: _ZTINSt3__119bad_expected_accessIvEE" at runtime
#include <expected>
#include <span>
#include <iostream>
int main() {
auto e = std::expected<std::span<char>, int>{};
std::cout << e.value().size() << ...
0
votes
0
answers
73
views
What's the differance of UnformattedInputFunction implementation between libstdc++ and libc++?
I'm manipulating raw input of keyboard in std c++.
The code working with libstdc++ but libc++.
When UP arrow key stroked,
get 1b 5b 41 output if compiled with g++ -std=c++23 rawkey.cpp or clang++ -...