libcxx

libcxx mirror with random patches
git clone https://git.neptards.moe/neptards/libcxx.git
Log | Files | Refs

proxy.pass.cpp (987B)


      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 // <iterator>
     11 
     12 // istreambuf_iterator
     13 
     14 // istreambuf_iterator(const proxy& p) throw();
     15 
     16 #include <iterator>
     17 #include <sstream>
     18 #include <cassert>
     19 
     20 int main()
     21 {
     22     {
     23         std::istringstream inf("abc");
     24         std::istreambuf_iterator<char> j(inf);
     25         std::istreambuf_iterator<char> i = j++;
     26         assert(i != std::istreambuf_iterator<char>());
     27         assert(*i == 'b');
     28     }
     29     {
     30         std::wistringstream inf(L"abc");
     31         std::istreambuf_iterator<wchar_t> j(inf);
     32         std::istreambuf_iterator<wchar_t> i = j++;
     33         assert(i != std::istreambuf_iterator<wchar_t>());
     34         assert(*i == L'b');
     35     }
     36 }