6
Il mio compilatore è clang 3.4, che supporta completamente C++ 14 e std::forward_list
.Perché `return {};` non si applica a `std :: forward_list`?
#include <forward_list>
struct A
{
A()
{}
explicit A(initializer_list<int>)
{}
};
A f1()
{
return A(); // OK
}
A f2()
{
return {}; // OK
}
typedef std::forward_list<int> T;
T f3()
{
return T(); // OK
}
T f4()
{
// error : converting to 'T {aka std::forward_list<int>}' from initializer
// list would use explicit constructor 'std::forward_list'
return {}; // ???
}
Perché return {};
si applica ai std::forward_list
?