How to determine the specialization of a member of a template class with initialization by default constructor?
The following program does not call the default constructor, as we would like:
#include <iostream> struct A { A() { std::cout << "Default constructor\n"; }; A(const A&) = delete; }; template<typename T> struct B { static T x; }; template<> A B<A>::x; // не вызывает конструктор int main() { }
= delete
from C ++ 11, so I mean that the question is still in modern C ++ - VTT{}
or= {}
. - AnT