rv_value.pass.cpp revision 712522cfd8f61321b4f197ec0de02b0146afb5a5
1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <iterator>
11
12// back_insert_iterator
13
14// requires CopyConstructible<Cont::value_type>
15//   back_insert_iterator<Cont>&
16//   operator=(Cont::value_type&& value);
17
18#include <iterator>
19
20#ifdef _LIBCPP_MOVE
21
22#include <vector>
23#include <memory>
24#include <cassert>
25
26template <class C>
27void
28test(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#endif  // _LIBCPP_MOVE
36
37int main()
38{
39#ifdef _LIBCPP_MOVE
40    test(std::vector<std::unique_ptr<int> >());
41#endif
42}
43