VCCC  2024.05
VisualCamp Common C++ library
const_iterator_t.hpp
Go to the documentation of this file.
1 //
2 // Created by cosge on 2024-01-27.
3 //
4 
5 #ifndef VCCC_RANGES_CONST_ITERATOR_T_HPP_
6 #define VCCC_RANGES_CONST_ITERATOR_T_HPP_
7 
8 #include <type_traits>
9 
10 #include "vccc/__ranges/cbegin.hpp"
11 #include "vccc/__ranges/range.hpp"
13 
14 namespace vccc {
15 namespace ranges {
16 namespace detail {
17 
19 struct const_iterator_impl {};
20 
21 template<typename T>
22 struct const_iterator_impl<T, true, void_t<decltype( ranges::cbegin(std::declval<T&>()) )>> {
23  using type = decltype(ranges::cbegin(std::declval<T&>()));
24 };
25 
26 } // namespace detail
27 
30 
31 template<typename T>
32 struct const_iterator : detail::const_iterator_impl<T> {};
33 
34 template<typename T>
36 
38 
39 } // namespace ranges
40 } // namespace vccc
41 
42 #endif // VCCC_RANGES_CONST_ITERATOR_T_HPP_
constexpr VCCC_INLINE_OR_STATIC detail::cbegin_niebloid cbegin
returns an iterator to the beginning of a read-only range
Definition: cbegin.hpp:46
typename const_iterator< T >::type const_iterator_t
Definition: const_iterator_t.hpp:35
void void_t
Definition: void_t.hpp:19
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: const_iterator_t.hpp:32