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

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -