libstdc++ Questions

1

I use clang++ for compiling C++ code. I link against the gcc standard C++ library, libstdc++. However, I have several different installation of libstdc++ on my Ubuntu machine. When I run clang++, i...
Mealy asked 8/11, 2016 at 11:43

1

Solved

Consider this simplified and very specific implementation of a recursive variant on top of std::variant: #include <map> #include <variant> struct recursive_tag; template <typename...
Miriam asked 29/5, 2018 at 16:43

1

Solved

Consider the following minimal example, consisting of three files: foo.h: #pragma once #include <memory> struct X { uint64_t i = 0xdeadbeefdeadbeefULL; }; void foo(); foo.cxx: #includ...
Guib asked 22/5, 2018 at 20:53

0

I've read that you can use Clang on Windows for C++ apps while using the MS implementation of the C++ standard library. But if you want to use libc++ on Windows, you currently need to use something...
Massotherapy asked 20/5, 2018 at 0:57

3

Solved

When is it necessary to use use the flag -stdlib=libstdc++ for the compiler and linker when compiling with gcc? Does the compiler automatically use libstdc++? I am using gcc4.8.2 on Ubuntu 13.10...
Dejection asked 4/11, 2013 at 18:43

1

Solved

For example, #include <random> struct stru { //inline static std::mt19937 rnd; Oops! inline static std::mt19937 rnd{}; }; int main() { } I see no semantic difference between the two, a...
Elna asked 13/5, 2018 at 9:33

1

Solved

Please consider std::exp defined in the header cmath in C++ numerics library. Now, please consider an implementation of the C++ Standard Library, say libstdc++. Considering there are various algor...
Hoad asked 21/4, 2018 at 20:36

1

I have a RHEL server (Maipo), and I did the Installing gcc 7.3 (gcc 7.3.0) - released 01/25/2018. For installing gcc, I followed How to Install gcc 5.3 with yum on CentOS 7.2? However, when insta...
Ita asked 12/4, 2018 at 13:33

2

Solved

As I am working on a C++ library that will be released publicly around 2014, I currently have design choices to make. One of the very useful tool that will be released with C++14 is std::optional. ...
Cide asked 9/6, 2013 at 20:9

2

Solved

Take a look at this: #include <iostream> #include <memory> using Foo = int; using FooPtr = std::shared_ptr<Foo>; FooPtr makeFoo() { FooPtr f{ new Foo(), [](Foo* ptr) { dele...
Pyridine asked 26/3, 2018 at 18:17

1

Solved

I think I have encountered an incorrect behaviour of std::poisson_distribution from C++ standard library. Questions: Could you confirm it is indeed a bug and not my error? What exactly is wrong ...
Recreate asked 1/12, 2017 at 4:6

1

TL;DR A program that uses the libc++ version of the getline function will block when it reads input from a pipe until the pipe's buffer is full. The same is NOT true for the libstdc++ version of ...
Claret asked 9/11, 2017 at 2:34

2

Solved

I have built a C++ app on a VM Ubuntu 16.04 on which I have installed g++ compiler 6.2.0 in order to support C++14 features. When I tried to run it on new clean VM 16.04 which has default the g++ 5...
Blinker asked 28/3, 2017 at 13:26

1

Solved

Yes, this might be the third time you see this code, because I asked two other questions about it (this and this).. The code is fairly simple: #include <vector> int main() { std::vector<...
Washko asked 7/8, 2017 at 3:24

2

Solved

Given a executable such that: >objdump -x someprog | grep c++ NEEDED libstdc++.so.6 I want to change the requirement to the full version (including the minor version and patch level): >objdu...
Silicify asked 21/7, 2017 at 12:12

1

Solved

According to cppreference.com, std::vector::emplace() offers the strong exception guarantee unconditionally: If an exception is thrown (e.g. by the constructor), the container is left unmodified...
Firry asked 16/7, 2017 at 4:53

3

Solved

I am trying to use std::regex in a C++11 piece of code, but it appears that the support is a bit buggy. An example: #include <regex> #include <iostream> int main (int argc, const char...
Howlend asked 21/9, 2012 at 12:13

1

Solved

test.cpp: #include <iostream> using namespace std; int main() { double pi = 3.14; cout << "pi:"<< pi << endl; } When compiled on cygwin 64-bit with g++ -mno-sse test.c...
Inadvertency asked 22/6, 2017 at 5:54

1

I would like change c++ standard library form microsoft to another which support c++17 standard. I mean swap vs lib with libstdc++ or libc++ Is is possible at all? I have not idea the way to do thi...
Wight asked 20/5, 2017 at 10:1

1

Solved

This is my first cmake file. I have a linux system with both clang and g++. Also libc++ is installed. I develop on Mac (xcode) but deploy to linux. I am writing a cmake file in which I can pick eit...
Sabah asked 27/4, 2017 at 16:4

1

Solved

struct Y { }; struct X : std::tuple<Y> { }; int main() { std::get<0>(std::make_tuple(X{})); } on wandbox The above code compiles and works as expected with clang++ when using lib...
Classicize asked 1/2, 2017 at 21:55

1

Solved

Given this program: struct Val { Val() = default; Val(Val&&) = default; auto& operator=(Val&&); }; /* PLACEHOLDER */ auto& Val::operator=(Val&&) { return *this...
Apportion asked 31/1, 2017 at 11:42

1

I'm using gcc on GNU/Linux and the debug-files and headers of libc and libstd++ are installed. But I don't know how to tell gdb to use the source-code of them, especially to debug into libstd++. Th...
Twelfth asked 15/4, 2013 at 20:11

1

Solved

Given this piece of code: #include <mutex> #include <iostream> void f(bool doThrow) { if (doThrow) { std::cout << "Throwing" << std::endl; throw 42; } std::cout <&...
Woodbridge asked 18/1, 2017 at 10:57

1

I try to build a little test case set for avr c++ builds. There are some "exceptional functions" provided typically from the c++ library. Now I want to write a test program which produces this wro...
Barogram asked 2/6, 2015 at 12:48

© 2022 - 2024 — McMap. All rights reserved.