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 //===----------------------------------------------------------------------===//
11 // template<class Iter>
12 // struct iterator_traits
14 // typedef typename Iter::difference_type difference_type;
15 // typedef typename Iter::value_type value_type;
16 // typedef typename Iter::pointer pointer;
17 // typedef typename Iter::reference reference;
18 // typedef typename Iter::iterator_category iterator_category;
22 #include <type_traits>
24 #include "test_macros.h"
30 typedef int difference_type
;
34 typedef std::forward_iterator_tag iterator_category
;
39 typedef std::iterator_traits
<test_iterator
> It
;
40 static_assert((std::is_same
<It::difference_type
, int>::value
), "");
41 static_assert((std::is_same
<It::value_type
, A
>::value
), "");
42 static_assert((std::is_same
<It::pointer
, A
*>::value
), "");
43 static_assert((std::is_same
<It::reference
, A
&>::value
), "");
44 static_assert((std::is_same
<It::iterator_category
, std::forward_iterator_tag
>::value
), "");