I want to create a nice table in stdout. The table has a lot of headers that are mainly compiletime strings. For example: std::cout << fmt::format("|{0:-^
Context: In my company we generate a lot of types based on IDL files. Some of the types require special logic so they are handcoded but follow the same pattern
In <cinttypes>, since C++11, there are the following two overloads: std::intmax_t abs( std::intmax_t n ); std::intmax_t imaxabs( std::intmax_t n ); Why
Using C++11, Ubuntu 14.04, GCC default toolchain. This code fails: constexpr std::string constString = "constString"; error: the type ‘const string
Background For a long time, gcc has been providing a number of builtin bit-twiddling functions, in particular the number of trailing and leading 0-bits (also f
What's the difference between constexpr and const? When can I use only one of them? When can I use both and how should I choose one?
Is there a difference between the following definitions? const double PI = 3.141592653589793; constexpr double PI = 3.141592653589793; If not, which styl
This declaration: char constexpr *const s = "hello"; Fails with this error: g++ -g -Wall -Werror -std=c++17 test.cc -o test test.cc:8:31: error: ISO C++11 d