VCCC  2024.05
VisualCamp Common C++ library
enumerate.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2024/01/22.
3 //
4 
5 #ifndef VCCC_RANGES_VIEWS_ENUMERATE_HPP
6 #define VCCC_RANGES_VIEWS_ENUMERATE_HPP
7 
8 #include <type_traits>
9 #include <tuple>
10 #include <utility>
11 
17 
18 namespace vccc {
19 namespace ranges {
20 namespace views {
21 namespace detail {
22 
23 template<template<typename...> class Tuple>
24 class enumerate_adaptor_closure : public range_adaptor_closure<enumerate_adaptor_closure<Tuple>> {
25  public:
27 
29  constexpr auto operator()(R&& r) const {
30  return enumerate_view<all_t<R>, Tuple>(std::forward<R>(r));
31  }
32 };
33 
34 } // namespace detail
35 
38 
40 
43 
45 
46 } // namespace views
47 } // namespace ranges
48 } // namespace vccc
49 
50 #endif // VCCC_RANGES_VIEWS_ENUMERATE_HPP
Definition: enumerate_view.hpp:64
constexpr auto operator()(R &&r) const
Definition: enumerate.hpp:29
constexpr VCCC_INLINE_OR_STATIC detail::enumerate_adaptor_closure< std::pair > enumerate_pair
return std::pair instead of std::tuple
Definition: enumerate.hpp:42
constexpr VCCC_INLINE_OR_STATIC detail::enumerate_adaptor_closure< std::tuple > enumerate
Definition: enumerate.hpp:39
#define VCCC_INLINE_OR_STATIC
Definition: inline_or_static.hpp:9
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
helper base class template for defining a range adaptor closure object
Definition: range_adaptor_closure.hpp:96