libstdc++ Questions
1
Solved
Taken from the GCC implementation of type_traits why is static_cast needed here?
template <typename _Tp, typename... _Args>
struct __is_nt_constructible_impl
: public integral_constant<b...
Perrie asked 7/1, 2020 at 11:28
3
Solved
Consider the following snippet:
#include <array>
int main() {
using huge_type = std::array<char, 20*1024*1024>;
huge_type t;
}
Obviously it would crash on most of platforms, becaus...
Scapegrace asked 6/1, 2020 at 20:28
1
Solved
I've come across this behavior of std::gcd that I found unexpected:
#include <iostream>
#include <numeric>
int main()
{
int a = -120;
unsigned b = 10;
//both a and b are represent...
Gosh asked 17/12, 2019 at 17:57
1
Solved
Consider this minimal example:
#include <filesystem>
#include <iostream>
int main()
{
std::cout << std::filesystem::current_path() << '\n';
}
It works as expected in GC...
Kreda asked 16/9, 2019 at 19:43
2
Solved
I am experiencing a very strange behavior, which I distilled down to a very basic test:
#include <string>
#include <filesystem>
int main(void)
{
const std::string name = "foo";
cons...
7
Solved
My client had some developer write a small c++ command-line app to run on their Linux servers. On one of the servers (running Fedora 11), when I execute the app I get the following error:
error wh...
2
Assume I have the following local gcc, g++ version:
$ gcc -v
$ g++ -v
gcc version 6.3.1
I don't understanding the relation and meaning of the following compared to my compiler version:
What is ...
5
Solved
I need to deploy a C++ application built on Ubuntu 12.10 with GCC 4.7's libstdc++ to systems running Ubuntu 10.04, which comes with a considerably older version of libstdc++.
Currently, I'm compili...
Heads asked 29/11, 2012 at 23:12
1
Solved
Based on the discussion here, I have reported a bug to the Ubuntu developers.
When compiling the following sample c++ program:
#include <cmath>
#include <stdio.h>
int main()
...
2
Solved
Looking at C++ compiler support, it appears that the untimed version of std::shared_mutex is available in GCC 5.0+. However, even with gcc version 5.3.0 20151204 (Ubuntu 5.3.0-3ubuntu1~14.04), and ...
2
my custom built gcc 4.6.0, installed in my home directory, on ubuntu 10.04, links the system libstdc++ instead of the custom built one, most of the time (as evidenced by ldd). to be more puzzling, ...
3
Solved
The code is fairly simple:
#include <vector>
int main() {
std::vector<int> v;
}
Then I build and run it with Valgrind on Linux:
g++ test.cc && valgrind ./a.out
==8511== Mem...
Teillo asked 7/8, 2017 at 0:37
0
I'm trying to upgrade an application to C++17 and am getting the following compiler error:
error: ‘__BEGIN_NAMESPACE_STD’ does not name a type
I'm using gcc (GCC) 8.2.0 and compiling with the fo...
3
Solved
I am trying to install Qt in my CentOS system. While building the library, I'm getting this error:
/root/capture/qt-everywhere-opensource-src-4.7.0/bin/qmake: error while loading shared libraries:...
2
Solved
When I use GCC, I can build program on my Ubuntu 15.04 using this:
-static-libgcc -static-libstdc++
And compiled binary can run on "stock" Ubuntu 14.04 without any external packages, only standa...
Hellgrammite asked 22/12, 2015 at 9:4
3
Solved
Recently I have taken a look at the implementation of std::not_fn function template provided by gcc.
The return type of this function template is _Not_fn - a wrapper class template which negates a...
5
I'm trying something spooky here. I'm trying to write C++ programs, compiled with GNU's g++, but without a dependency on libstdc++ :) but it seems that I need that for even the most basic things ne...
3
Solved
The macro __GLIBCXX__ contains the time stamp of libstdc++ releases, e.g., from gcc documentation (https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html)
__GLIBCXX__
The current ver...
2
Solved
Both libstdc++ and libc++ makes moved-from std::string object empty, even if the original stored string is short and short string optimization is applied. It seems to me that this emptying makes an...
Lazurite asked 8/10, 2018 at 6:18
1
I'm trying to build a binary with GCC 4.9.0 that is backwards-compatible against libstdc++. According to GCC's ABI Policy and Guidelines and Options Controlling C++ Dialect, the command line option...
1
Solved
I'm using gcc-4.9 which does not have the is_trivially_constructible type trait. Looking into the libstdc++ source code (type_traits), this depends on __is_trivially_constructible which is implemen...
Erivan asked 18/4, 2018 at 13:42
1
Solved
Consider the situation when a C++ project is built and shipped within a Centos 7 virtual machine or container. Default gcc for Centos 7 is 4.8. In order to allow developers to use modern C++, the m...
Weltpolitik asked 2/10, 2018 at 13:22
2
Solved
I am working on some research and would like to edit some of the source code in the libstdc++ library for experimentation. I am, specifically, interested in experimenting with the parallel sorting ...
Fascista asked 19/2, 2014 at 5:54
1
Solved
I am scratching my head on std::optional which, according to the docs, shouldn't have a constexpr assignment operator.
However, when I try this snippet in gcc-8.1, it compiles and works just fine:...
Chlorous asked 19/8, 2018 at 19:9
© 2022 - 2024 — McMap. All rights reserved.