VCCC  2024.05
VisualCamp Common C++ library
cartesian_product.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2024/01/27.
3 //
4 
5 #ifndef VCCC_RANGES_VIEWS_CARTESIAN_PRODUCT_HPP
6 #define VCCC_RANGES_VIEWS_CARTESIAN_PRODUCT_HPP
7 
8 #include <tuple>
9 #include <type_traits>
10 
16 
18 
19 namespace vccc {
20 namespace ranges {
21 namespace views {
22 namespace detail {
23 
25  constexpr auto operator()() const {
26  return views::single(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::cartesian_product_view<all_t<Rs&&>...>(std::forward<Rs>(rs)...);
34  }
35 };
36 
37 } // namespace detail
48 
52 
54 
55 } // namespace views
56 } // namespace ranges
57 } // namespace vccc
58 
59 #endif // VCCC_RANGES_VIEWS_CARTESIAN_PRODUCT_HPP
Definition: cartesian_product_view.hpp:170
constexpr VCCC_INLINE_OR_STATIC detail::cartesian_product_niebloid cartesian_product
Definition: cartesian_product.hpp:51
constexpr VCCC_INLINE_OR_STATIC detail::single_niebloid single
Definition: single.hpp:104
#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
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: cartesian_product.hpp:32
constexpr auto operator()() const
Definition: cartesian_product.hpp:25