python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Definition of static data member without repeating its type
When I have a class with a static const or constexpr data member, defining that variable reqires me to repeat stuff:
/// my_class.hpp
class my_class { constexpr static int x = 1; };
/// my_class.cpp
...
Quirin F. Schroll
Votes: 0
Answers: 3
inline static constexpr vs global inline constexpr
Suppose that I have a few inline constexpr variables (named as default_y and default_x) in a header file and I decided to move them to a class that they are completely related to and mark them static ...
digito_evo
Votes: 0
Answers: 1
if constexpr behavior differs between C++17 and C++20
I am seeing some unexpected compile-time behavior when compiling a piece of code using MSVC 17.1.3 in C++20 standard compliance mode.
#include <type_traits>
#include <stdexcept>
template ...
Regus Pregus
Votes: 0
Answers: 0
Captured in-line array in constexpr variable gets lost on runtime
I'm trying to create an [int/enum]-to-text mapping class with as little overhead as possible for it's users. It's constructor should be passed a list of value-to-text mappings, which can be queried a...
Carl Colijn
Votes: 0
Answers: 2