libc++ Questions
1
Solved
I have a small code as follows:
int main() {
double d;
const char* str = "26.50";
std::from_chars(str, str + strlen(str), d);
std::cout << d;
}
This code works as expected with...
1
I noted that much of boost and libc++/libstdc++ explicitly provide a default value of zero for SFINAE in code like
// libc++ http://llvm.org/svn/llvm-project/libcxx/trunk/include/memory
namespace ...
1
Solved
1
I'm using clang 10 and gcc 9 on Ubuntu 20.04.
Taking this following sample program:
#include <cstdio>
#include <any>
int main(int argc, char* argv[])
{
std::any v = argc;
printf(&quo...
1
Solved
Generally, the default constructor should be the fastest way of making an empty container.
That's why I was surprised to see that it's worse than initializing to an empty string literal:
#include &...
Impearl asked 25/6, 2023 at 23:40
1
Solved
In libc++, the specialization of std::array<T,0> has a member (const) char array, which is aligned and sized according to T (source). I wonder what is the reason for this implementation since...
3
Solved
The function std::char_traits::copy is implemented in libc++ like this:
template <class _CharT>
inline _LIBCPP_CONSTEXPR_AFTER_CXX17
_CharT*
char_traits<_CharT>::copy(char_type* __s1, c...
1
vcpkg uses the GCC installation package by default on Linux. I see that the official document mentions the custom triplet method, but does not mention the clang tool chain.
How can I specify clang ...
1
Solved
In libc++'s implementation of std::function, if the function object whose type is being erased is small enough to fit inside an SBO then the move operation will copy it, not move it. Yet not every ...
Auklet asked 11/1, 2023 at 12:4
1
I'm trying to build libc++ with MemorySanitizer instrumentation so that I can build my own projects with MemorySanitizer. I am using Clang 8.01 on Ubuntu 16.04.
I followed the instructions given h...
Infusible asked 5/6, 2019 at 3:51
2
I have a couple of questions.
1) What is libc++ and libstdc++ ?
2) What is the difference between them ?
3) Are they interchangeable ?
4) Is it something a compiler should implement ?
5) When ...
0
libc++ shared_ptr implementation release() for the sake of simplicity can be depicted as:
void release()
{
if (ref_count.fetch_sub(1, std::memory_order_acq_rel) == 1)
{
delete this;
}
}
Why do...
Selena asked 17/6, 2022 at 14:42
1
Solved
In my version of clang and libc++ (near HEAD), this static_assert passes:
static_assert(std::is_copy_constructible_v<std::vector<std::unique_ptr<int>>>)
Of course if you actually...
Toughen asked 26/3, 2022 at 21:50
6
I am wondering what is the right/easy way to install a binary libc++ on Ubuntu, in my case Trusty aka 14.04?
On the LLVM web site there are apt packages http://apt.llvm.org/ and I have used these ...
2
Solved
I'd like to know if it is possible to use an object reference as a key in an unordered_map container in C++.
#include <unordered_map>
class Object {
int value;
};
struct object_hash {
in...
1
I've been Googling around for months trying to solve this, but nothing I've tried works.
So a simple program like this:
#include <concepts>
#include <iostream>
int main() {
std::cout ...
Doorstep asked 2/9, 2021 at 23:8
4
Solved
The first couple are too long to reference. I get this error when I try to compile clang++ -stdlib=libc++ ../main.cc ... with clang and libc++ from the SVN.
error: undefined reference to 'typeinfo...
Gibber asked 10/8, 2011 at 19:38
2
My macOS version is 10.14
Xcode version is 10.2
To write the plugin for clang. I just install the llvm and clang from Github with following commands.
git clone https://github.com/llvm/llvm-proje...
Collative asked 14/8, 2019 at 12:22
2
2
From cppreference
std::chrono::years (since C++20)
duration</*signed integer type of at least 17 bits*/, std::ratio<31556952>>
Using libc++, it seems the underlining storage of st...
Vilberg asked 13/3, 2020 at 10:4
2
Solved
Is there a good source of information on C++11 standard support in libc++? Its web site says 98% of the standard is supported but I'd like to know what features the other 2% are.
Something simila...
2
I want to enable debug version of libc++ in macOS, so I define _LIBCPP_DEBUG=1 in cxx_build_flags [Debug Version of libC++],
but unable to link debug function of libc++. I guess there is only relea...
3
Solved
I want to try parallel STL of C++17. However, I can't find experimental/execution_policy in libc++. How can I try this?
I'm trying http://en.cppreference.com/w/cpp/experimental/reduce, which says ...
Ancylostomiasis asked 17/5, 2017 at 9:29
1
Solved
I noticed std::set::equal_range (same for std::map) in clang's libc++ gives different result than libstdc++.
I always assumed equal_range should return equivalent of std::make_pair(set.lower_bound(...
3
While trying to install cvxpy package using pip install on Mac, I get the following error message:
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to ...
Nellnella asked 28/10, 2018 at 15:35
1 Next >
© 2022 - 2024 — McMap. All rights reserved.