
27 Jan
2007
27 Jan
'07
5:32 p.m.
Ovanes Markarian wrote:
Just a small addition. You can also specialize the template in another file, that is seen in the translation unit.
Be aware, however, that it's not necessarily a good idea: If you forget to #include the specialization definition, an instantiation of is_pointer_like<T>::value can be both 'false' and 'true' in the same program. This scenario can lead to strange effects that are not necessarily caught at compile time. You should at least add a forward declaration of the class template specialization to the header defining the smart pointer (but you might as well just define the specialization in this case because it's trivial). Regards, Tobias