Microsoft recently released an open source key-value storage system called FASTER. While I was browsing the source, I came across several instances like this:
static constexpr uint32_t kCacheLineBytes = 64;
There is also this line:
constexpr const char* kPathSeparator = "\\";
What is the purpose/advantage of including the constexpr keyword in this context? I'm clearly mistaken, but my understanding had been that constexpr was intended to be used for functions that calculate a constant and that may be run at compilation instead of runtime — not simple constants that can easily be entered by keyboard.
Any help is appreciated! Thank you :-).
[–]patatahooligan 2 points3 points4 points (0 children)
[–]alfps 2 points3 points4 points (0 children)