| 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 | // UNSUPPORTED: c++03 |
| 10 | |
| 11 | // <iterator> |
| 12 | |
| 13 | // front_insert_iterator |
| 14 | |
| 15 | // front_insert_iterator<Cont>& |
| 16 | // operator=(Cont::value_type&& value); |
| 17 | |
| 18 | #include <cassert> |
| 19 | #include <iterator> |
| 20 | #include <list> |
| 21 | #include <memory> |
| 22 | |
| 23 | #include "test_macros.h" |
| 24 | #include "test_constexpr_container.h" |
| 25 | |
| 26 | template <class C> |
| 27 | TEST_CONSTEXPR_CXX20 bool |
| 28 | test(C c) |
| 29 | { |
| 30 | std::front_insert_iterator<C> i(c); |
| 31 | i = typename C::value_type(); |
| 32 | assert(c.front() == typename C::value_type()); |
| 33 | return true; |
| 34 | } |
| 35 | |
| 36 | int main(int, char**) |
| 37 | { |
| 38 | test(std::list<std::unique_ptr<int> >()); |
| 39 | #if TEST_STD_VER >= 20 |
| 40 | test(ConstexprFixedCapacityDeque<int, 10>()); |
| 41 | static_assert(test(ConstexprFixedCapacityDeque<int, 10>())); |
| 42 | #endif |
| 43 | return 0; |
| 44 | } |
| 45 | |