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 // explicit forward_list(size_type n); 13 14 #include <forward_list> 15 #include <cassert> 16 17 #include "../../../DefaultOnly.h" 18 19 int main() 20 { 21 { 22 typedef DefaultOnly T; 23 typedef std::forward_list<T> C; 24 unsigned N = 10; 25 C c = N; 26 unsigned n = 0; 27 for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n) 28 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 29 assert(*i == T()); 30 #else 31 ; 32 #endif 33 assert(n == N); 34 } 35 } 36