C++ Templates : define an array -


i have template

template <class t, int size=0> class gpr  

and want declare array example int [5], requires specify size example 5. if write :

gpr<int, 5> ap;  

does mean have int[5] or need modify place of int:

gpr<new int[5], 5> app;  

?? or

gpr<double, 5> pda = new double[5]; 

??

it dependent on class implementation. can access using gpr ap; , gpr app; create array of template object.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -