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 // template<class T>
12 // struct iterator_traits<const T*>
13
14 #include <iterator>
15 #include <type_traits>
16
17 #include "test_macros.h"
18
19 struct A {};
20
main(int,char **)21 int main(int, char**)
22 {
23 typedef std::iterator_traits<const volatile A*> It;
24 static_assert((std::is_same<It::difference_type, std::ptrdiff_t>::value), "");
25 static_assert((std::is_same<It::value_type, A>::value), "");
26 static_assert((std::is_same<It::pointer, const volatile A*>::value), "");
27 static_assert((std::is_same<It::reference, const volatile A&>::value), "");
28 static_assert((std::is_same<It::iterator_category, std::random_access_iterator_tag>::value), "");
29 #if TEST_STD_VER > 17
30 ASSERT_SAME_TYPE(It::iterator_concept, std::contiguous_iterator_tag);
31 #endif
32 return 0;
33 }
34