According to this, a function declared with constexpr
must satisfy a few requirements, one of which is as follows:
there exists at least one argument value such that an invocation of the function could be an evaluated subexpression of a core constant expression ...
Well, constexpr
function can have no arguments:
constexpr int Bar( /* empty */ ) { return 0xFF; }
constexpr int value = Bar(); // Valid expression
constexpr
function that is invoked as a sub-routine can not determine the whole expression to be core constant expression either.
So what does it mean by one argument value must exist?
[Update for future readers]
Apparently the description about the requirements of constexpr function
has been fixed since this question from:
there exists at least one argument value such that an invocation of the function could be an evaluated subexpression of a core constant expression ...
to:
there exists at least one set of argument values such that an invocation of the function could be an evaluated subexpression of a core constant expression ...