On 7/31/19 4:27 AM, Niall Douglas wrote:
Just fixing up path_view with the feedback from SG16 and LEWG right now.

Does anybody have to hand a char8_t implementation for C++ 14? I've
currently got a hacky substitute which is really char, but I'd like
something better, if somebody already has implemented char_traits et al
for older C++.

With both gcc (9.1) and Clang (7, 8) you can enable char8_t with the '-fchar8_t' option for earlier standard modes.  I'm not sure that is helpful for your use case though.

If you can't use the '-fchar8_t' option, then you have two options:

  1. Introduce a 'char8_t' type alias of 'char' that is for documentation purposes only.  Obviously, you won't be able to overload based on that.
  2. Take JeanHeyd's suggestion and introduce a 'char8_t' alias of 'unsigned char' and roll your own 'char_traits' and friends.

Tom.