post.pass.cpp revision bc8d3f97eb5c958007f2713238472e0c1c8fe02c
145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org//===----------------------------------------------------------------------===//
245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org//
345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org// ��������������������The LLVM Compiler Infrastructure
445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org//
545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org// This file is distributed under the University of Illinois Open Source
645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org// License. See LICENSE.TXT for details.
745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org//
845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org//===----------------------------------------------------------------------===//
945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
1045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org// <iterator>
1145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
1245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org// back_insert_iterator
1345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
1445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org// back_insert_iterator<Cont> operator++(int);
1545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
1645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#include <iterator>
1745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#include <vector>
1845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#include <cassert>
1945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
2045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtemplate <class C>
2145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid
2245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtest(C c)
2345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org{
2445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    std::back_insert_iterator<C> i(c);
2545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    std::back_insert_iterator<C> r = i++;
2645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    r = 0;
2745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    assert(c.size() == 1);
2845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    assert(c.back() == 0);
2945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org}
3045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
3145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgint main()
3245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org{
3345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    test(std::vector<int>());
3445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org}
3545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org