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// back_insert_iterator<Cont> 14// back_inserter(Cont& x); 15 16#include <iterator> 17#include <vector> 18#include <cassert> 19 20template <class C> 21void 22test(C c) 23{ 24 std::back_insert_iterator<C> i = std::back_inserter(c); 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