I have 2 enable_ifs... the first DOES NOT WORK, the second DOES!! Why??
-------- FIRST enable_if constructor for dummy class error_player-------
template<class _Enum, class = typename std::enable_if<std::is_error_condition_enum<_Enum>::value,void>::type>
error_player(_Enum _Errcode) _NOEXCEPT
{ // construct from enumerated error code
}
-------- SECOND enable_if constructor for dummy class error_player-------
template<class _Enum, typename std::enable_if<std::is_error_condition_enum<_Enum>::value>::type* = nullptr>
error_player(_Enum _Errcode) _NOEXCEPT
{ // construct from enumerated error code
}
--------------------
I took the first one from the declaration of the ctor for error_condition, which isn't working for me and is as follows:
template<class _Enum,
class = typename enable_if<is_error_condition_enum<_Enum>::value,
void>::type>
error_condition(_Enum _Errcode) _NOEXCEPT
: _Myval(0), _Mycat(0)
{ // construct from enumerated error code
*this = make_error_condition(_Errcode); // using ADL
}
This is using MS Visual Studio 2015...
When I try to use code to create an object from error_player or from error_condition, like so:
However I wonder if we could ask you to use code tags always, even for the small code fragments.
The scope of your questions is quite often beyond my ability to provide an answer, but it would be nice (for others too) if your question was a little more readable.