Hi
I am reading template chapter in c++.
We can specizlize a primary template both Partial and Explicit.
But what are the differences?Advantages and disadvantages.?
Thanks
Hi
I am reading template chapter in c++.
We can specizlize a primary template both Partial and Explicit.
But what are the differences?Advantages and disadvantages.?
Thanks
A partial template is a version of a class template where some (not all) of the template parameters are specified. The advantages are obvious, since you may want to "fix" some of the parameters to certain data types.
Code:template <class myClass1, class myClass2> class some_template { /* ... */ }; // a partial specialization: fixes 2nd parameter as int. First parameter varies template <class myClass1> class some_template<myClass1, int> { /* ... */ };
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.