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 remove(const value_type& v); 13 14 #include <forward_list> 15 #include <iterator> 16 #include <cassert> 17 18 int main() 19 { 20 { 21 typedef int T; 22 typedef std::forward_list<T> C; 23 const T t1[] = {0, 5, 5, 0, 0, 0, 5}; 24 const T t2[] = {5, 5, 5}; 25 C c1(std::begin(t1), std::end(t1)); 26 C c2(std::begin(t2), std::end(t2)); 27 c1.remove(0); 28 assert(c1 == c2); 29 } 30 { 31 typedef int T; 32 typedef std::forward_list<T> C; 33 const T t1[] = {0, 0, 0, 0}; 34 C c1(std::begin(t1), std::end(t1)); 35 C c2; 36 c1.remove(0); 37 assert(c1 == c2); 38 } 39 { 40 typedef int T; 41 typedef std::forward_list<T> C; 42 const T t1[] = {5, 5, 5}; 43 const T t2[] = {5, 5, 5}; 44 C c1(std::begin(t1), std::end(t1)); 45 C c2(std::begin(t2), std::end(t2)); 46 c1.remove(0); 47 assert(c1 == c2); 48 } 49 { 50 typedef int T; 51 typedef std::forward_list<T> C; 52 C c1; 53 C c2; 54 c1.remove(0); 55 assert(c1 == c2); 56 } 57 { 58 typedef int T; 59 typedef std::forward_list<T> C; 60 const T t1[] = {5, 5, 5, 0}; 61 const T t2[] = {5, 5, 5}; 62 C c1(std::begin(t1), std::end(t1)); 63 C c2(std::begin(t2), std::end(t2)); 64 c1.remove(0); 65 assert(c1 == c2); 66 } 67 } 68