Home | History | Annotate | Download | only in back.insert.iter.op=
      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 // UNSUPPORTED: c++98, c++03
     11 
     12 // <iterator>
     13 
     14 // back_insert_iterator
     15 
     16 // requires CopyConstructible<Cont::value_type>
     17 //   back_insert_iterator<Cont>&
     18 //   operator=(Cont::value_type&& value);
     19 
     20 #include <iterator>
     21 
     22 #include <vector>
     23 #include <memory>
     24 #include <cassert>
     25 
     26 template <class C>
     27 void
     28 test(C c)
     29 {
     30     std::back_insert_iterator<C> i(c);
     31     i = typename C::value_type();
     32     assert(c.back() == typename C::value_type());
     33 }
     34 
     35 int main()
     36 {
     37     test(std::vector<std::unique_ptr<int> >());
     38 }
     39