test.pass.cpp revision bc8d3f97eb5c958007f2713238472e0c1c8fe02c
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 <BackInsertionContainer Cont>
13//   front_insert_iterator<Cont>
14//   front_inserter(Cont& x);
15
16#include <iterator>
17#include <list>
18#include <cassert>
19
20template <class C>
21void
22test(C c)
23{
24    std::front_insert_iterator<C> i = std::front_inserter(c);
25    i = 0;
26    assert(c.size() == 1);
27    assert(c.front() == 0);
28}
29
30int main()
31{
32    test(std::list<int>());
33}
34