2010-05-11 21:42:16 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2010-05-11 23:36:01 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
2010-05-11 21:42:16 +02:00
|
|
|
//
|
2010-11-16 23:09:02 +01:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-05-11 21:42:16 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// <list>
|
|
|
|
|
|
|
|
// void pop_back();
|
|
|
|
|
2013-04-05 02:18:49 +02:00
|
|
|
#if _LIBCPP_DEBUG2 >= 1
|
|
|
|
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
|
|
|
#endif
|
|
|
|
|
2010-05-11 21:42:16 +02:00
|
|
|
#include <list>
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
int a[] = {1, 2, 3};
|
|
|
|
std::list<int> c(a, a+3);
|
|
|
|
c.pop_back();
|
|
|
|
assert(c == std::list<int>(a, a+2));
|
|
|
|
c.pop_back();
|
|
|
|
assert(c == std::list<int>(a, a+1));
|
|
|
|
c.pop_back();
|
|
|
|
assert(c.empty());
|
2013-04-05 02:18:49 +02:00
|
|
|
#if _LIBCPP_DEBUG2 >= 1
|
|
|
|
c.pop_back();
|
|
|
|
assert(false);
|
|
|
|
#endif
|
2010-05-11 21:42:16 +02:00
|
|
|
}
|