Can user-defined CTAD parameters be declared with auto&&?

30 Views Asked by At

LiveDemo: https://godbolt.org/z/daP7c8av6

template<typename T>
struct A {
    A(T);
};

// OK
template<typename T>
A(T&&) -> A<T&&>;

template<typename T>
struct B {
  B(T);
};

// GCC&Clang: OK
// MSVC: error C3539: a template-argument cannot be a type that contains 'auto'
B(auto&& ref) -> B<decltype(ref)>;
0

There are 0 best solutions below