Home | History | Annotate | Download | only in conversions.buffer
      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 // wbuffer_convert<Codecvt, Elem, Tr>
     13 
     14 // streambuf *rdbuf(streambuf *bytebuf);
     15 
     16 #include <locale>
     17 #include <codecvt>
     18 #include <sstream>
     19 #include <cassert>
     20 
     21 int main()
     22 {
     23     typedef std::wbuffer_convert<std::codecvt_utf8<wchar_t> > B;
     24     {
     25         std::stringstream s;
     26         B b;
     27         assert(b.rdbuf() == nullptr);
     28         b.rdbuf(s.rdbuf());
     29         assert(b.rdbuf() == s.rdbuf());
     30     }
     31 }
     32