1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
11 // constexpr counted_iterator() requires default_initializable<I> = default;
15 #include "test_macros.h"
16 #include "test_iterators.h"
18 constexpr bool test() {
19 static_assert(!std::default_initializable
<std::counted_iterator
<cpp17_input_iterator
<int*>>>);
20 static_assert( std::default_initializable
<std::counted_iterator
<forward_iterator
<int*>>>);
22 std::counted_iterator
<forward_iterator
<int*>> iter
;
23 assert(iter
.base() == forward_iterator
<int*>());
24 assert(iter
.count() == 0);
29 int main(int, char**) {
31 static_assert(test());