On 11/05/21 21:00 +0100, Jonathan Wakely wrote:
Alternatively, would it be even simpler to just define a partial
specialization of ctype?

template<typename _CharT, typename _Traits, typename _Alloc>
 class ctype<basic_string<_CharT, _Traits, _Alloc> >
 {
#if __cplusplus >= 201103L
     static_assert(something dependent,
                    "std::basic_string used as a character type");
#endif
 private:
   ctype();
   ~ctype();
 };

This will work in C++98 too.

Or just leave it undefined, as libc++ seems to do according to your
comment in PR 89728:

error: implicit instantiation of undefined template 
'std::__1::ctype<std::__1::basic_string<char> >'

Was your aim to have a static_assert that gives a more descriptive
error? We could leave it undefined in C++98 and have the static assert
for C++11 and up.

Reply via email to