0

This is related to:

std::basic_string specialization and Circumventing template specialization

I tried the solution from std::basic_string specialization, but the problem is that CustomChar is a typedef for wchar_t and I have redefinition(conflict with specialization from std). How may I avoid usage of chart_traits when I'm not allowed to change CustomChar typedef?

Community
  • 1
  • 1
Mircea Ispas
  • 20,260
  • 32
  • 123
  • 211
  • 2
    You can supply an alternative `traits` class (i.e. something other than a `std::char_traits` specialization) while still using `wchar_t` as the `charT` template parameter to `std::basic_string`. – CB Bailey Jul 01 '11 at 13:09
  • This is why C++ should be taken outside and shot. – Bjarke Ebert Nov 23 '15 at 20:21

2 Answers2

0

This is the answer provided by Charles Bailey as a comment:

You can supply an alternative traits class (i.e. something other than a std::char_traits specialization) while still using wchar_t as the charT template parameter to std::basic_string

Mircea Ispas
  • 20,260
  • 32
  • 123
  • 211
0

You could use Boost's/C++0x's disable_if to disable if there are known previous instantiations, like in the case of char and wchar_t.

rubenvb
  • 74,642
  • 33
  • 187
  • 332