C++ any good method to generate specialization for template class? -
for example, template class a:
template <class t> class { public: void function(const t & r); }; i want make specialization char*, char[] type, example:
template <> class a<char*> { public: void function(const char * r); }; template <> class a<char[]> { public: void function(const char * r); }; string specialization has these type:
<char*> <wchar_t*> <const char*> <const wchar_t*> <volatile char*> <volatile wchar_t*> <const volatile char*> <const volatile wchar_t*> <char[]> <wchar_t[]> <const char[]> <const wchar_t[]> <volatile char[]> <volatile wchar_t[]> <const volatile char[]> <const volatile wchar_t[]> if template class has many member functions, have write many needless code cover 16 string types, , it's boring.
are there method generate these code ?
Comments
Post a Comment