Files
cbindgen/tests/expectations/constant_constexpr.cpp
T
AlaskanEmily 462871695d Add option to output constexpr generated constant primitive values
This is controlled by the [const] allow_constexpr option, similar to the
allow_static_const option.

It's only applied to primitives currently.
2020-03-03 20:46:12 +01:00

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 };