28 #ifndef YB_INC_ystdex_any_iterator_hpp_
29 #define YB_INC_ystdex_any_iterator_hpp_ 1
78 template<
typename _type>
83 ref_handler<value_type>, value_handler<value_type>>;
87 template<
typename _type>
94 using base::get_reference;
113 base::manage(d, s, op);
119 template<
typename _type>
126 using base::get_reference;
139 d.
access<
bool>() = get_reference(*p) == get_reference(s);
151 template<
typename _type>
158 using base::get_reference;
167 template<
typename _type>
174 using base::get_reference;
197 #define YB_IterOp1(_n, _t, _it, _e) \
198 template<typename _type, typename _tDifference, typename _tPointer, \
199 typename _tReference> \
201 _n(const _it<_type, _tDifference, _tPointer, _tReference>& i) \
206 #define YB_IterOp2(_n, _t, _it, _e) \
207 template<typename _type, typename _tDifference, typename _tPointer, \
208 typename _tReference> \
210 _n(const _it<_type, _tDifference, _tPointer, _tReference>& x, \
211 const _it<_type, _tDifference, _tPointer, _tReference>& y) \
216 #define YB_IterOpPost(_op, _it) \
234 template<
typename _type,
typename _tDifference = ptrdiff_t,
235 typename _tPointer = _type*,
typename _tReference = _type&>
237 _tDifference, _tPointer, _tReference>,
protected any
249 template<
typename _tIterator>
256 static_assert(is_convertible<decltype(*std::declval<
typename
258 "Wrong target iterator type found.");
268 :
any(static_cast<
any&&>(i))
284 static_cast<any&
>(*this) =
static_cast<any&&
>(i);
321 return static_cast<const any&
>(*this);
350 return t.access<
bool>();
376 template<
typename _type,
typename _tDifference = ptrdiff_t,
377 typename _tPointer = _type*,
typename _tReference = _type&>
387 template<
typename _tIterator>
446 template<
typename _type,
typename _tDifference = ptrdiff_t,
447 typename _tPointer = _type*,
typename _tReference = _type&>
457 template<
typename _tIterator>
any_bidirectional_iterator & operator=(const any_bidirectional_iterator &)=default
remove_cv_t< remove_reference_t< _type >> type
any_input_iterator()=default
typename conditional< _bCond, _type, _type2 >::type conditional_t
bool equals(const any_input_iterator &i) const
any_forward_iterator()=default
any_input_iterator & operator++()
any_bidirectional_iterator(_tIterator &&i)
any_forward_iterator & operator=(const any_forward_iterator &)=default
#define YB_IterOpPost(_op, _it)
typename wrapped_traits< _type >::type value_type
#define yforward(_expr)
根据参数类型使用 std::forward 传递对应参数。
bidirectional_iteartor_op
typename wrap_handler< _type >::type base
static void manage(any_storage &d, const any_storage &s, any_ops::op_code op)
static void manage(any_storage &d, const any_storage &s, any_ops::op_code op)
any_input_iterator(_tIterator &&i)
构造:使用现有迭代器。
bool check_undereferenceable() const
reference operator*() const
typename base::value_type value_type
any_forward_iterator & operator++()
const std::type_info & type() const
random_access_iteartor_op
any_ops::any_storage storage
pointer operator->() const
any_forward_iterator(_tIterator &&i)
conditional_t< wrapped_traits< _type >::value, ref_handler< value_type >, value_handler< value_type >> type
#define YB_IterOp2(_n, _t, _it, _e)
any_input_iterator & operator=(const any_input_iterator &)=default
typename base::value_type value_type
typename base::value_type value_type
bool is_undereferenceable(const any_input_iterator< _type, _tDifference, _tPointer, _tReference > &i)
any_ops::any_manager manager
static void manage(any_storage &d, const any_storage &s, any_ops::op_code op)
any_bidirectional_iterator()=default
std::forward_iterator_tag iterator_category
#define YB_IterOp1(_n, _t, _it, _e)
any_bidirectional_iterator & operator++()