test.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// template <InsertionContainer Cont>
13//   insert_iterator<Cont>
14//   inserter(Cont& x, Cont::iterator i);
15
16#include <iterator>
17#include <vector>
18#include <cassert>
19
20template <class C>
21void
22test(C c)
23{
24    std::insert_iterator<C> i = std::inserter(c, c.end());
25    i = 0;
26    assert(c.size() == 1);
27    assert(c.back() == 0);
28}
29
30int main()
31{
32    test(std::vector<int>());
33}
34