462871695d
This is controlled by the [const] allow_constexpr option, similar to the allow_static_const option. It's only applied to primitives currently.
19 lines
310 B
C++
19 lines
310 B
C++
#include <cstdarg>
|
|
#include <cstdint>
|
|
#include <cstdlib>
|
|
#include <new>
|
|
|
|
constexpr float CONSTANT_FLOAT32 = 312.292;
|
|
|
|
constexpr int64_t CONSTANT_I64 = 216;
|
|
|
|
constexpr uint32_t DELIMITER = ':';
|
|
|
|
constexpr uint32_t LEFTCURLY = '{';
|
|
|
|
struct Foo {
|
|
int32_t x;
|
|
};
|
|
|
|
static const Foo SomeFoo = Foo{ /* .x = */ 99 };
|