The following compiled with VS2015, but fails in VS2017 with the below errors. Was the code doing something non standard that has been fixed in VS2017, or should VS2017 compile
This might be a bug in Visual Studio. A possible workaround could be using template specialization instead of overloading:
template
struct is_flags { constexpr static bool value = false; };
template <>
struct is_flags { constexpr static bool value = true; };
template std::enable_if_t::value, std::underlying_type_t> operator | (E lhs, E rhs)
{
return ToUnderlying(lhs) | ToUnderlying(rhs);
}