VCCC  2024.05
VisualCamp Common C++ library
legacy_iterator.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/25.
3 //
4 
5 #ifndef VCCC_ITERATOR_ITERATOR_TRAITS_LEGACY_ITERATOR_HPP_
6 #define VCCC_ITERATOR_ITERATOR_TRAITS_LEGACY_ITERATOR_HPP_
7 
8 #include <type_traits>
9 
15 
16 namespace vccc {
17 namespace detail {
18 
19 template<typename I, bool = dereferenceable<decltype(std::declval<I&>()++)>::value>
20 struct LegacyIteratorCheckPostIncrement_2 : std::false_type {};
21 template<typename I>
22 struct LegacyIteratorCheckPostIncrement_2<I, true> : is_referencable<decltype(*std::declval<I&>()++)> {};
23 
25 struct LegacyIteratorCheckPostIncrement : std::false_type {};
26 template<typename I>
27 struct LegacyIteratorCheckPostIncrement<I, true> : LegacyIteratorCheckPostIncrement_2<I> {};
28 
29 } // namespace detail
30 
39 struct LegacyIterator : std::false_type {};
40 
41 template<typename I>
42 struct LegacyIterator<I, true>
43  : conjunction<
44  is_referencable<decltype(*std::declval<I&>())>,
45  detail::is_pre_incrementable<I>,
46  detail::LegacyIteratorCheckPostIncrement<I>,
47  copyable<I>
48 > {};
49 
52 
53 } // namespace vccc
54 
55 #endif // VCCC_ITERATOR_ITERATOR_TRAITS_LEGACY_ITERATOR_HPP_
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: legacy_iterator.hpp:39
Definition: conjunction.hpp:22