The following simple code produces an error in the newest Visual Studio compiler (MSVC 2015 Update 2):
struct Foo
{
template<typename ... Args, typename = std::enable_if_t<sizeof...(Args) != 0> >
Foo(Args ...) {}
Foo() = default; // error
//Foo() {} //this works!
};
The error message is
error C2580: 'Foo::Foo(void)': multiple versions of a defaulted special member functions are not allowed
gcc accepts it without any problems.
This seems to me as an obvious bug (in the sense that it is not supported by the standard). Any other views?
This is a bug in VS 2015 Update 2. We've already fixed the bug (202164, though that's an internal bug number.) This code should work in Update 3 builds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With