Re:C++17 constexpr everything, or as much as the compiler can
by bilboa on Thursday December 28, 2017 @10:18AM
(#16022389)
Apparently constexpr is like "inline". Just as the inline keyword doesn't actually guarantee that the compiler will inline a function, so constexpr doesn't require the compiler to precompute something, but rather just gives a hint to the compiler that you'd like it to if it can.
[ Parent
| on HN ]
Re:C++17 constexpr everything, or as much as the compiler can
by mike_hock on Thursday December 28, 2017 @10:31AM
(#16022482)
constexpr means you CAN use the function in a constant expression
inline means you CAN define a function in multiple translation units without violating ODR
no guarantees in the other direction