ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
Iterator.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*----------------------------- File Iterator.h ----------------------------*/
3/*--------------------------------------------------------------------------*/
33/*--------------------------------------------------------------------------*/
34/*----------------------------- DEFINITIONS --------------------------------*/
35/*--------------------------------------------------------------------------*/
36
37#ifndef __ADS_interop_boost_Iterator
38 #define __ADS_interop_boost_Iterator
39/* self-identification: #endif constant */
40
41#if defined( ADS_WITH_BOOST )
42
43/*--------------------------------------------------------------------------*/
44/*------------------------------ INCLUDES ----------------------------------*/
45/*--------------------------------------------------------------------------*/
46
47#include <boost/iterator/iterator_categories.hpp>
48
49#include <iterator>
50#include <type_traits>
51
52/*--------------------------------------------------------------------------*/
53/*--------------------------- NAMESPACE ------------------------------------*/
54/*--------------------------------------------------------------------------*/
55
57namespace ADS
58{
59
62template< class I >
63void adsIteratorProbe( const I & );
64
65namespace detail
66{
67
68template< class I >
69void adsIteratorProbe( const I & );
70
71} // end( namespace detail )
72
73namespace bgl::probe
74{
75
76void adsIteratorProbe( void ) = delete; // only by ADL
77
79template< class I >
80concept of_ads = requires( const I & i )
81{ adsIteratorProbe( i ); };
82
83} // end( namespace bgl::probe )
84
85namespace bgl
86{
87
90template< class I >
91concept built_reference_iterator =
92 probe::of_ads< I > && std::forward_iterator< I > &&
93 std::is_same_v< typename std::iterator_traits< I >::iterator_category ,
94 std::input_iterator_tag >;
95
96} // end( namespace bgl )
97
98} // end( namespace ADS )
99
100namespace boost::iterators
101{
102
105template< class I >
106 requires ADS::bgl::built_reference_iterator< I >
107struct iterator_traversal< I >
108{
109 using type = std::conditional_t<
110 std::random_access_iterator< I > , random_access_traversal_tag ,
111 std::conditional_t< std::bidirectional_iterator< I > ,
112 bidirectional_traversal_tag , forward_traversal_tag > >;
113 };
114
115} // end( namespace boost::iterators )
117
118#endif /* ADS_WITH_BOOST */
119
120/*--------------------------------------------------------------------------*/
121
122#endif /* Iterator.h included */
123
124/*--------------------------------------------------------------------------*/
125/*--------------------------- End File Iterator.h --------------------------*/
126/*--------------------------------------------------------------------------*/
GrB_Type type(void)
the type of GraphBLAS of the numbers T: GrB_BOOL, the integers of 8 to 64 bits with or without sign,...
Definition GraphBLAS.h:128
Definition ADT.h:96