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 is definitely a bug in Visual Studio. It compiles on GCC and Clang. It seems to be related with constexpr
functions evaluated as template parameters. As a temporary workaround, you can make a template variable:
template
bool constexpr is_flags_v = IsFlags(T{});
template
std::enable_if_t, std::underlying_type_t> operator | (E lhs, E rhs)
{
return ToUnderlying(lhs) | ToUnderlying(rhs);
}
On Godbolt