| 12345678910111213141516171819202122232425262728293031 |
- //
- // sentinel.h
- // stream
- //
- // Created by Sam Jaffe on 4/8/23.
- //
- #pragma once
- #include <iterator/sentinel.h>
- #include <stream/forward.h>
- #include <stream/detail/traits.h>
- #include <stream/detail/macro.h>
- namespace stream::ranges {
- constexpr sentinel_t sentinel{};
- template <typename Self, typename Base, typename... Args>
- auto sentinel_end(Self *, Base && base, Args &&... args) {
- if constexpr (detail::has_sentinal_v<Base>) {
- return FWD(base).end();
- } else {
- return detail::begin_t<Self>(FWD(base).end(), FWD(args)...);
- }
- }
- }
- #include <stream/detail/undef.h>
|