Home | History | Annotate | Download | only in locale.ctype
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <locale>
     11 
     12 // template <class CharT>
     13 // class ctype
     14 //     : public locale::facet,
     15 //       public ctype_base
     16 // {
     17 // public:
     18 //     typedef CharT char_type;
     19 // };
     20 
     21 #include <locale>
     22 #include <type_traits>
     23 #include <cassert>
     24 
     25 int main()
     26 {
     27     std::locale l = std::locale::classic();
     28     {
     29         assert(std::has_facet<std::ctype<wchar_t> >(l));
     30         const std::ctype<wchar_t>& f = std::use_facet<std::ctype<wchar_t> >(l);
     31         ((void)f); // Prevent unused warning
     32         {
     33             (void)std::ctype<wchar_t>::id;
     34         }
     35         static_assert((std::is_same<std::ctype<wchar_t>::char_type, wchar_t>::value), "");
     36         static_assert((std::is_base_of<std::ctype_base, std::ctype<wchar_t> >::value), "");
     37         static_assert((std::is_base_of<std::locale::facet, std::ctype<wchar_t> >::value), "");
     38     }
     39 }
     40