Quantcast
Channel: How to know the template type in the template constructor - Stack Overflow
Browsing index pages (2 articles)

How to know the template type in the template constructor

here is an exemple :template< typename T >class A {public : A(void) { this->_tab = ???[x]; }private:T* _tab;};I would like to initialize my array with x elements but how to get the type of my...

View Article


Answer by ForEveR for How to know the template type in the template constructor

Just this should work.this->_tab = new T[x];

View Article

Browsing index pages (2 articles)


Latest Images