Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Commit 508b1a0

Browse files
authored
Add make_tagged_iterator
make_tagged_iterator<Tag, Iterator>(iterator); tparam `Iterator` could be skipped due to function template type deduction.
1 parent a9f33f1 commit 508b1a0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

thrust/iterator/detail/tagged_iterator.h

+15
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ template<typename Iterator, typename Tag>
5858
: super_t(x) {}
5959
}; // end tagged_iterator
6060

61+
/*! \p make_tagged_iterator creates a \p tagged_iterator
62+
* from a \c Iterator with system tag \c Tag.
63+
*
64+
* \tparam Tag Any system tag.
65+
* \tparam Iterator Any iterator type.
66+
* \param iter The iterator of interest.
67+
* \return An iterator whose system tag is \p Tag and whose behavior is otherwise
68+
* equivalent to \p iter.
69+
*/
70+
template <typename Tag, typename Iterator>
71+
inline auto make_tagged_iterator(Iterator iter)
72+
{
73+
return tagged_iterator<Iterator, Tag>(iter);
74+
}
75+
6176
} // end detail
6277

6378
// tagged_iterator is trivial if its base iterator is.

0 commit comments

Comments
 (0)