1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <iterator> 10 11 // front_insert_iterator 12 13 // explicit front_insert_iterator(Cont& x); // constexpr in C++20 14 15 #include <iterator> 16 #include <list> 17 18 #include "test_macros.h" 19 #include "nasty_containers.h" 20 #include "test_constexpr_container.h" 21 22 template <class C> 23 TEST_CONSTEXPR_CXX20 bool test(C c)24test(C c) 25 { 26 std::front_insert_iterator<C> i(c); 27 return true; 28 } 29 main(int,char **)30int main(int, char**) 31 { 32 test(std::list<int>()); 33 test(nasty_list<int>()); 34 #if TEST_STD_VER >= 20 35 test(ConstexprFixedCapacityDeque<int, 10>()); 36 static_assert(test(ConstexprFixedCapacityDeque<int, 10>())); 37 #endif 38 return 0; 39 } 40