1//===----------------------------------------------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is dual licensed under the MIT and the University of Illinois Open 6// Source Licenses. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10// <forward_list> 11 12// void pop_front(); 13 14#include <forward_list> 15#include <cassert> 16 17#include "MoveOnly.h" 18#include "min_allocator.h" 19 20int main() 21{ 22 { 23 typedef int T; 24 typedef std::forward_list<T> C; 25 typedef std::forward_list<T> C; 26 C c; 27 c.push_front(1); 28 c.push_front(3); 29 c.pop_front(); 30 assert(distance(c.begin(), c.end()) == 1); 31 assert(c.front() == 1); 32 c.pop_front(); 33 assert(distance(c.begin(), c.end()) == 0); 34 } 35#if TEST_STD_VER >= 11 36 { 37 typedef MoveOnly T; 38 typedef std::forward_list<T> C; 39 C c; 40 c.push_front(1); 41 c.push_front(3); 42 c.pop_front(); 43 assert(distance(c.begin(), c.end()) == 1); 44 assert(c.front() == 1); 45 c.pop_front(); 46 assert(distance(c.begin(), c.end()) == 0); 47 } 48 { 49 typedef int T; 50 typedef std::forward_list<T, min_allocator<T>> C; 51 typedef std::forward_list<T, min_allocator<T>> C; 52 C c; 53 c.push_front(1); 54 c.push_front(3); 55 c.pop_front(); 56 assert(distance(c.begin(), c.end()) == 1); 57 assert(c.front() == 1); 58 c.pop_front(); 59 assert(distance(c.begin(), c.end()) == 0); 60 } 61 { 62 typedef MoveOnly T; 63 typedef std::forward_list<T, min_allocator<T>> C; 64 C c; 65 c.push_front(1); 66 c.push_front(3); 67 c.pop_front(); 68 assert(distance(c.begin(), c.end()) == 1); 69 assert(c.front() == 1); 70 c.pop_front(); 71 assert(distance(c.begin(), c.end()) == 0); 72 } 73#endif 74} 75