An experiment in constexpr parameters.
A note on macro naming: For options, use TV_OPTION_ON
and TV_OPTION_OFF
(i.e., for the KEYWORD
option, you'd define TV_OPTION_OFF_KEYWORD
if you
didn't want the typeval
keyword to be defined). If one defines both, the
library will error at you. For standard defaults, use TV_STD_CPPXY
; the
default option is CPP14
. Internal macros are denoted by TV_INTERNAL
- do not
touch these.
Options:
-
VARIABLE_TEMPLATES
-- Whether to define variable templates (_v
templates) -
DECLTYPE_AUTO
-- Whether to usedecltype(auto)
, or-> decltype(...)
. With the latter, you can't usetypeval
with lambdas, but it's legal under C++11 -
KEYWORD
-- Whether to definetypeval
(otherwise, useTV_MAKE_TYPEVAL
) -
CONSTEXPR_LAMBDA
-- Whether to make the lambdas constexpr. This is the only way one would be able to usemake_typeval
in a constant expression.
Standard defaults:
- CPP11:
VARIABLE_TEMPLATES
- offCONSTEXPR_LAMBDA
- offDECLTYPE_AUTO
- off
- CPP14 (default):
VARIABLE_TEMPLATES
- onCONSTEXPR_LAMBDA
- offDECLTYPE_AUTO
- on
- CPP17
VARIABLE_TEMPLATES
- onCONSTEXPR_LAMBDA
- onDECLTYPE_AUTO
- on
KEYWORD
is on by default in all standards