Warning: function uses 'auto' type specifier without trailing return type
The auto
return type "without trailing return type" is a C++14 feature, so I suppose you're compiling C++11.
Your code is OK with C++14, but for C++11, if you want use auto
as return type, you need describe the effective return type in this way (caution: pseudocode)
auto funcName (args...) -> returnType
You know that sizeof()
returns std::size_t
, so your example can be corrected as
constexpr auto MaxEventSize() -> std::size_t
{
return cexMax(sizeof(int),
cexMax(sizeof(int),
sizeof(int)));
};
or (silly, in this case, but show the use in more complex examples)
constexpr auto MaxEventSize() -> decltype( cexMax(sizeof(int),
cexMax(sizeof(int),
sizeof(int))) )
{
return cexMax(sizeof(int),
cexMax(sizeof(int),
sizeof(int)));
};