@@ -107,15 +107,6 @@ struct is_trailing_null_type< tuples::null_type > : std::true_type {};
107107template < >
108108struct is_trailing_null_type < fusion::void_ > : std::true_type {};
109109
110- // The trait checks if the tail is either an empty type list or begins with a "null" type, which indicates that the rest
111- // of the types in the tail are unused
112- template < typename ... Tail >
113- struct is_tail_empty ;
114- template < >
115- struct is_tail_empty < > : std::true_type {};
116- template < typename Front, typename ... Tail >
117- struct is_tail_empty < Front, Tail... > : detail::is_trailing_null_type< Front > {};
118-
119110// Metafunction to obtain the type of the tuple whose element types
120111// are the reference types of an iterator tuple.
121112template < typename IteratorTuple >
@@ -161,30 +152,28 @@ struct minimum_traversal_category_in_iterator_list;
161152template < typename IteratorList >
162153using minimum_traversal_category_in_iterator_list_t = typename minimum_traversal_category_in_iterator_list< IteratorList >::type;
163154
164- template < typename FrontTraversal, typename Tail >
165- using minimum_traversal_category_in_tail_t = min_category_t <
166- FrontTraversal,
167- minimum_traversal_category_in_iterator_list_t < Tail >
168- >;
169-
170- template < template < typename ... > class List , typename Front, typename ... Tail >
171- struct minimum_traversal_category_in_iterator_list < List< Front, Tail... > >
155+ template < template < typename ... > class List , typename ... Iterators >
156+ struct minimum_traversal_category_in_iterator_list < List< Iterators... > >
172157{
173- using front_traversal = pure_iterator_traversal_t < Front >;
174-
175158 // Note: non-variadic Boost.Tuple and Boost.Fusion need special handling
176159 // to avoid instantiating iterator traits on the trailing "null" types.
177- // Note 2: we rename the List to mp_list in the process of iteration to
178- // avoid specifying one template parameter to std::pair, if List is std::pair .
179- using type = mp11::mp_eval_if <
180- detail::is_tail_empty< Tail... >,
181- front_traversal ,
182- minimum_traversal_category_in_tail_t ,
183- front_traversal,
184- mp11::mp_list< Tail ... >
160+ // For such types just use random_access_traversal_tag, which will not
161+ // affect the result of min_category .
162+ using type = min_category_t <
163+ mp11::mp_eval_if<
164+ detail::is_trailing_null_type< Iterators > ,
165+ random_access_traversal_tag ,
166+ pure_iterator_traversal_t , Iterators
167+ > ...
185168 >;
186169};
187170
171+ template < typename FrontTraversal, typename Tail >
172+ using minimum_traversal_category_in_tail_t = min_category_t <
173+ FrontTraversal,
174+ minimum_traversal_category_in_iterator_list_t < Tail >
175+ >;
176+
188177template < typename Front, typename Tail >
189178struct minimum_traversal_category_in_iterator_list < tuples::cons< Front, Tail > >
190179{
0 commit comments