T
TimSweeneyEpic
Guest
// In Visual C++ 15.7.6, constructor deduction guides work with simple constructors:
template<class t> struct class0 {class0(t) {}};
class0(char)->class0<char>;
int testclass0() noexcept {class0('x');}
// However, they seem broken in the case of templated constructors as follows:
template<class t> struct class1 {template<class u> class1(u) {}};
class1(char)->class1<char>;
int testclass1() noexcept {class1('x');}
// error C2672: 'class1': no matching overloaded function found
// error C2783: 'class1<t> class1(u)': could not deduce template argument for 't'
Any advice?
Continue reading...
template<class t> struct class0 {class0(t) {}};
class0(char)->class0<char>;
int testclass0() noexcept {class0('x');}
// However, they seem broken in the case of templated constructors as follows:
template<class t> struct class1 {template<class u> class1(u) {}};
class1(char)->class1<char>;
int testclass1() noexcept {class1('x');}
// error C2672: 'class1': no matching overloaded function found
// error C2783: 'class1<t> class1(u)': could not deduce template argument for 't'
Any advice?
Continue reading...