9
Declarations
[dcl.dcl]
9.2
Specifiers
[dcl.spec]
9.2.3
Function specifiers
[dcl.fct.spec]
1
#
A
function-specifier
can be used only in a function declaration
.
function-specifier
:
virtual
explicit-specifier
explicit-specifier
:
explicit
(
constant-expression
)
explicit
2
#
The
virtual
specifier shall be used only in the initial declaration of a non-static member function; see
[class.
virtual]
.
3
#
An
explicit-specifier
shall be used only in the declaration of a constructor or conversion function within its class definition; see
[class.
conv.
ctor]
and
[class.
conv.
fct]
.
4
#
In an
explicit-specifier
, the
constant-expression
, if supplied, shall be a contextually converted constant expression of type
bool
(
[expr.
const]
)
.
The
explicit-specifier
explicit
without a
constant-expression
is equivalent to the
explicit-specifier
explicit
(
true
)
.
If the constant expression evaluates to
true
, the function is explicit
.
Otherwise, the function is not explicit
.
A
(
token that follows
explicit
is parsed as part of the
explicit-specifier
.