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

Add make_tagged_iterator #1586

Merged
merged 2 commits into from
Apr 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions thrust/iterator/detail/tagged_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ template<typename Iterator, typename Tag>
: super_t(x) {}
}; // end tagged_iterator

/*! \p make_tagged_iterator creates a \p tagged_iterator
* from a \c Iterator with system tag \c Tag.
*
* \tparam Tag Any system tag.
* \tparam Iterator Any iterator type.
* \param iter The iterator of interest.
* \return An iterator whose system tag is \p Tag and whose behavior is otherwise
* equivalent to \p iter.
*/
template <typename Tag, typename Iterator>
inline auto make_tagged_iterator(Iterator iter)
ericniebler marked this conversation as resolved.
Show resolved Hide resolved
{
return tagged_iterator<Iterator, Tag>(iter);
}

} // end detail

// tagged_iterator is trivial if its base iterator is.
Expand Down