libstdc++

How you create your own views that interact with existing views with operator |?

孤街醉人 提交于 2021-02-16 04:38:54
问题 Why does this code work with the #if 0 block in place, but fails with a fairly complex set of error messages if you remove it? And more importantly, how do I make it the same result as the very similar block above it? #include <ranges> #include <iterator> #include <optional> #include <string_view> #include <iostream> #include <algorithm> template <::std::ranges::view View, typename Pred> requires ::std::ranges::input_range<View> && ::std::ranges::common_range<View> && ::std::is_object_v<Pred>

How you create your own views that interact with existing views with operator |?

穿精又带淫゛_ 提交于 2021-02-16 04:36:33
问题 Why does this code work with the #if 0 block in place, but fails with a fairly complex set of error messages if you remove it? And more importantly, how do I make it the same result as the very similar block above it? #include <ranges> #include <iterator> #include <optional> #include <string_view> #include <iostream> #include <algorithm> template <::std::ranges::view View, typename Pred> requires ::std::ranges::input_range<View> && ::std::ranges::common_range<View> && ::std::is_object_v<Pred>

How you create your own views that interact with existing views with operator |?

妖精的绣舞 提交于 2021-02-16 04:35:41
问题 Why does this code work with the #if 0 block in place, but fails with a fairly complex set of error messages if you remove it? And more importantly, how do I make it the same result as the very similar block above it? #include <ranges> #include <iterator> #include <optional> #include <string_view> #include <iostream> #include <algorithm> template <::std::ranges::view View, typename Pred> requires ::std::ranges::input_range<View> && ::std::ranges::common_range<View> && ::std::is_object_v<Pred>

How to support dynamic plugins when statically linking in standard libraries?

大城市里の小女人 提交于 2021-02-10 05:40:50
问题 Suppose an application myapp.exe is built using g++ and it uses the flag -static-libstdc++ so that it can be installed in enviroments without libstdc++.so . myapp.exe also adds plugin support for some function plugf that can be dynamically loading via dlopen from a shard library. If libplug.so is such a plugin library that also links to libstdc++ , how can it do so in a way to be able to work with myapp.exe ? This is straightforward if libstdc++ is linked in dynamically since both myapp.exe

How to support dynamic plugins when statically linking in standard libraries?

让人想犯罪 __ 提交于 2021-02-10 05:39:17
问题 Suppose an application myapp.exe is built using g++ and it uses the flag -static-libstdc++ so that it can be installed in enviroments without libstdc++.so . myapp.exe also adds plugin support for some function plugf that can be dynamically loading via dlopen from a shard library. If libplug.so is such a plugin library that also links to libstdc++ , how can it do so in a way to be able to work with myapp.exe ? This is straightforward if libstdc++ is linked in dynamically since both myapp.exe

Value of `__GLIBCXX__` for each libstdc++ release

你说的曾经没有我的故事 提交于 2021-02-08 20:52:18
问题 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 version of libstdc++ in compressed ISO date format, as an unsigned long. For details on the value of this particular macro for a particular release, please consult the ABI Policy and Guidelines appendix. I am looking for the values for all releases since the release of 4.9.0 (including releases of smaller

cmake detect which library libc++ or libstdc++ is configured to be used against g++ or clang++

╄→гoц情女王★ 提交于 2021-02-05 06:43:05
问题 I wrote an CMakeLists.txt to build a project with either g++ or clang++ . To catch as many as possible bugs I use both libc++ with -D_LIBCPP_DEBUG2=2 (for clang++ ) and libstdc++ with -D_GLIBCXX_DEBUG (for both g++ and clang++ ). set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -fno-inline -DDEBUG=1 -march=x86-64 -mtune=generic") #[[ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_DEBUG2=2") elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") set

Understanding the gcc version and the GLIBC, GLIBCXX versions in more detail

自作多情 提交于 2021-02-05 05:07:47
问题 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 this referring to? /usr/lib64/libstdc++.so.6 Trying to run a binary and I get this error, what is GLIBCXX_3.4.20 referring to? why is the number starting with 3? /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found What is all this? $ strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX GLIBCXX_3.4

Understanding the gcc version and the GLIBC, GLIBCXX versions in more detail

大兔子大兔子 提交于 2021-02-05 05:04:41
问题 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 this referring to? /usr/lib64/libstdc++.so.6 Trying to run a binary and I get this error, what is GLIBCXX_3.4.20 referring to? why is the number starting with 3? /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found What is all this? $ strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX GLIBCXX_3.4

Why does GCC's ifstream >> double allocate so much memory?

感情迁移 提交于 2021-01-21 12:10:27
问题 I need to read a series of numbers from a space-separated human-readable file and do some math, but I've run into some truly bizarre memory behavior just reading the file. If I read the numbers and immediately discard them... #include <fstream> int main(int, char**) { std::ifstream ww15mgh("ww15mgh.grd"); double value; while (ww15mgh >> value); return 0; } My program allocates 59MB of memory according to valgrind, scaling linearly with respect to the size of the file: $ g++ stackoverflow.cpp