C++
General Tips
Difference between
constexprandconstconstprevents variables from being modified,constexprtells the compiler that an expression results in a compile-time constantOnly values known at compile time can be assigned to
constexprWhen applied to functions,
constcan only be used for non-static member functionsGuarentees the member function does not modify any non-static data members
constexprcan be used with member and non-member functionsDeclares function fit for use in constant expressions
Arguments and return types must be literal types
Links
Last updated