This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

4.3.0/include/c++/bits/boost_concept_check.h - RandomAccessIteratorConcept Concept check ambiguous


we  have ambiguous requirement
see:

template <class _Tp>
 struct _RandomAccessIteratorConcept
 {
   void __constraints() {
     __function_requires< _BidirectionalIteratorConcept<_Tp> >();
     __function_requires< _ComparableConcept<_Tp> >();
     __function_requires< _ConvertibleConcept<
       typename std::iterator_traits<_Tp>::iterator_category,
       std::random_access_iterator_tag> >();
     // ??? We don't use _Ref, are we just checking for "referenceability"?
     typedef typename std::iterator_traits<_Tp>::reference _Ref;

__i += __n; // require assignment addition operator
__i = __i + __n; // require addition with difference type



//__i = __n + __i; !!!!!!!!!!!!!!! ambiguous !!!!!!!!!!!!!!!



__i = __i - __n; // require subtraction with
// difference type
__n = __i - __j; // require difference operator
(void)__i[__n]; // require element access operator
}
_Tp __a, __b;
_Tp __i, __j;
typename std::iterator_traits<_Tp>::difference_type __n;
};


what type expression __n + __i; must has ? std::iterator_traits<_Tp>::difference_type or _Tp ?
what operator+ compiler must and can use ?


best regards
Bulavitsky Alexey



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]