VCCC  2024.05
VisualCamp Common C++ library
zip.hpp
Go to the documentation of this file.
1 //
2 // Created by YongGyu Lee on 4/9/24.
3 //
4 
5 #ifndef VCCC_RANGES_VIEWS_ZIP_HPP_
6 #define VCCC_RANGES_VIEWS_ZIP_HPP_
7 
8 #include <tuple>
9 #include <type_traits>
10 
18 
19 namespace vccc {
20 namespace ranges {
21 namespace views {
22 namespace detail {
23 
24 struct zip_niebloid {
25  constexpr auto operator()() const {
26  return vccc_decay_copy(views::empty<std::tuple<>>);
27  }
28 
29  template<typename... Rs, std::enable_if_t<conjunction<
31  >::value, int> = 0>
32  constexpr auto operator()(Rs&&... rs) const {
33  return ranges::zip_view<views::all_t<decltype((rs))>...>(rs...);
34  }
35 };
36 
37 } // namespace detail
38 
41 
43 
45 
46 } // namespace views
47 } // namespace ranges
48 } // namespace vccc
49 
50 #endif // VCCC_RANGES_VIEWS_ZIP_HPP_
Definition: zip_view.hpp:109
#define vccc_decay_copy(x)
Definition: decay_copy.hpp:12
constexpr VCCC_INLINE_OR_STATIC detail::zip_niebloid zip
Definition: zip.hpp:42
typename detail::all_t_impl< R >::type all_t
Calculates the suitable view type of a viewable_range type.
Definition: all.hpp:107
#define VCCC_INLINE_OR_STATIC
Definition: inline_or_static.hpp:9
constexpr VCCC_INLINE_OR_STATIC empty_view< T > empty
Definition: empty_view.hpp:53
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: conjunction.hpp:22
specifies the requirements for a range to be safely convertible to a view
Definition: viewable_range.hpp:59
constexpr auto operator()(Rs &&... rs) const
Definition: zip.hpp:32
constexpr auto operator()() const
Definition: zip.hpp:25