VCCC  2024.05
VisualCamp Common C++ library
borrowed_subrange_t.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2024/01/08.
3 //
4 
5 #ifndef VCCC_RANGES_BORROWED_SUBRANGE_T_HPP_
6 #define VCCC_RANGES_BORROWED_SUBRANGE_T_HPP_
7 
8 #include <type_traits>
9 
13 #include "vccc/__ranges/range.hpp"
15 
16 namespace vccc {
17 namespace ranges {
18 namespace detail {
19 
21 struct borrowed_subrange_impl {
22  using type = std::conditional_t<borrowed_range<R>::value, subrange<iterator_t<R>>, dangling>;
23 };
24 
25 template<typename R>
26 struct borrowed_subrange_impl<R, false> {};
27 
28 } // namespace detail
29 
32 
33 template<typename R>
34 struct borrowed_subrange : detail::borrowed_subrange_impl<R> {};
35 
36 template<typename R>
37 using borrowed_subrange_t = typename borrowed_subrange<R>::type;
38 
40 
41 } // namespace vccc
42 } // namespace ranges
43 
44 #endif // VCCC_RANGES_BORROWED_SUBRANGE_T_HPP_
typename borrowed_subrange< R >::type borrowed_subrange_t
Definition: borrowed_subrange_t.hpp:37
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: borrowed_subrange_t.hpp:34