VCCC  2024.05
VisualCamp Common C++ library
filter.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 1/24/24.
3 //
4 
5 #ifndef VCCC_RANGES_VIEWS_FILTER_HPP
6 #define VCCC_RANGES_VIEWS_FILTER_HPP
7 
8 #include <type_traits>
9 
17 
18 namespace vccc {
19 namespace ranges {
20 namespace views {
21 namespace detail {
22 
25  constexpr auto operator()(R&& r, Pred&& pred) const {
26  return filter_view<all_t<R>, remove_cvref_t<Pred>>(std::forward<R>(r), std::forward<Pred>(pred));
27  }
28 
29  template<typename Pred>
30  constexpr auto operator()(Pred&& pred) const {
31  return range_adaptor<filter_niebloid, std::decay_t<Pred>>{std::forward<Pred>(pred)};
32  }
33 };
34 
35 } // namespace detail
36 
39 
41 
43 
44 } // namespace views
45 } // namespace ranges
46 } // namespace vccc
47 
48 #endif // VCCC_RANGES_VIEWS_FILTER_HPP
Definition: filter_view.hpp:113
Definition: range_adaptor.hpp:25
constexpr VCCC_INLINE_OR_STATIC detail::filter_niebloid filter
Definition: filter.hpp:40
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
constexpr auto operator()(Pred &&pred) const
Definition: filter.hpp:30
constexpr auto operator()(R &&r, Pred &&pred) const
Definition: filter.hpp:25