Suppose you attempt to do the following:
template</* args */>
typename std::enable_if< /*conditional*/ , /*type*/ >::type
static auto hope( /*args*/) -> decltype( /*return expr*/ )
{
}
Is it possible to combine conditional inclusion/overloading (std::enable_if
) with trailing-return-type (auto ... -> decltype()
)?
I would not be interesting in solutions using the preprocessor. I can always do things like
#define RET(t) --> decltype(t) { return t; }
and extend it to take also the whole conditional. Instead I am interested if the language supports it without using another trait for the return type, i.e. ReturnType<A,B>::type_t
or whatever is used in the function body.