I want to create a class with a template constructor:
class foo { template <class T> foo(T var) {} };
This compiles in VS2008, but I have no idea if this is a non-standard extension or a C ++ standard.
In [temp.mem]:
A template can be declared in a class or class template; such a template is called a member template.
Constructors are members and are not explicitly allowed to create templates.
For example, std::shared_ptr has many template constructors .
std::shared_ptr
Source: https://habr.com/ru/post/958694/More articles:Register all autofac modules from the assembly on one line - .netIs there a memory cache for the portable class library? - c #Does Scala Async do everything Clojure core.async does? - macrosHow to count the number of rows from sql table in C #? - c #How to make rsync read SRC from STDIN? - linuxGet dates next week in PHP - dateHibernate org.hibernate.LazyInitializationException: failed to lazily initialize role collection: - javaJPA LazyInitializationException when returning a JAXB object through Webservice - jpazip and upload files using php - phpWhen terminating a Handler with background radiation in iOS 7 with NSOperation - objective-cAll Articles