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

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -