VCCC  2024.05
VisualCamp Common C++ library
repeat.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2024/01/30.
3 //
4 
5 #ifndef VCCC_RANGES_VIEWS_REPEAT_HPP
6 #define VCCC_RANGES_VIEWS_REPEAT_HPP
7 
8 #include <type_traits>
9 
20 
21 namespace vccc {
22 namespace ranges {
23 namespace views {
24 namespace detail {
25 
27  template<typename W, std::enable_if_t<conjunction<
28  move_constructible< remove_cvref_t<W> >,
29  std::is_object< remove_cvref_t<W> >
30  >::value, int> = 0>
31  constexpr auto operator()(W&& value) const {
33  return RV(std::forward<W>(value));
34  }
35 
36  template<typename W, typename Bound, std::enable_if_t<conjunction<
37  move_constructible< remove_cvref_t<W> >,
38  std::is_object< remove_cvref_t<W> >,
42  >
43  >::value, int> = 0>
44  constexpr auto operator()(W&& value, Bound&& bound) const {
46  return RV(std::forward<W>(value), std::forward<Bound>(bound));
47  }
48 };
49 
50 } // namespace detail
51 
52 
55 
57 
59 
60 } // namespace views
61 } // namespace ranges
62 } // namespace vccc
63 
64 #endif // VCCC_RANGES_VIEWS_REPEAT_HPP
Definition: repeat_view.hpp:34
constexpr VCCC_INLINE_OR_STATIC detail::repeat_niebloid repeat
Definition: repeat.hpp:56
typename remove_cvref< T >::type remove_cvref_t
Definition: remove_cvref.hpp:24
#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
Definition: disjunction.hpp:22
Check if type models integer-like type (C++ 20 requirement)
Definition: is_integer_like.hpp:34
constexpr auto operator()(W &&value) const
Definition: repeat.hpp:31
constexpr auto operator()(W &&value, Bound &&bound) const
Definition: repeat.hpp:44
Models std::same_as
Definition: same_as.hpp:33
sentinel that always compares unequal to any weakly_incrementable type
Definition: unreachable_sentinel.hpp:17