VCCC  2024.05
VisualCamp Common C++ library
borrowed_iterator_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_ITERATOR_T_HPP_
6 #define VCCC_RANGES_BORROWED_ITERATOR_T_HPP_
7 
8 #include <type_traits>
9 
13 #include "vccc/__ranges/range.hpp"
14 
15 namespace vccc {
16 namespace ranges {
17 namespace detail {
18 
20 struct borrowed_iterator_impl {
21  using type = std::conditional_t<borrowed_range<R>::value, iterator_t<R>, dangling>;
22 };
23 
24 template<typename R>
25 struct borrowed_iterator_impl<R, false> {};
26 
27 } // namespace detail
28 
31 
32 template<typename R>
33 struct borrowed_iterator : detail::borrowed_iterator_impl<R> {};
34 
35 template<typename R>
36 using borrowed_iterator_t = typename borrowed_iterator<R>::type;
37 
39 
40 } // namespace vccc
41 } // namespace ranges
42 
43 #endif // VCCC_RANGES_BORROWED_ITERATOR_T_HPP_
typename borrowed_iterator< R >::type borrowed_iterator_t
Definition: borrowed_iterator_t.hpp:36
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: borrowed_iterator_t.hpp:33