forked from boostorg/concept_check
removed TrivialIterator concept
[SVN r20488]
This commit is contained in:
@@ -535,35 +535,16 @@ struct require_same { typedef T type; };
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
// Iterator Concepts
|
// Iterator Concepts
|
||||||
|
|
||||||
template <class TT>
|
|
||||||
struct TrivialIteratorConcept
|
|
||||||
{
|
|
||||||
void constraints() {
|
|
||||||
function_requires< AssignableConcept<TT> >();
|
|
||||||
function_requires< DefaultConstructibleConcept<TT> >();
|
|
||||||
function_requires< EqualityComparableConcept<TT> >();
|
|
||||||
(void)*i; // require dereference operator
|
|
||||||
}
|
|
||||||
TT i;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class TT>
|
|
||||||
struct Mutable_TrivialIteratorConcept
|
|
||||||
{
|
|
||||||
void constraints() {
|
|
||||||
function_requires< TrivialIteratorConcept<TT> >();
|
|
||||||
*i = *j; // require dereference and assignment
|
|
||||||
}
|
|
||||||
TT i, j;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class TT>
|
template <class TT>
|
||||||
struct InputIteratorConcept
|
struct InputIteratorConcept
|
||||||
{
|
{
|
||||||
void constraints() {
|
void constraints() {
|
||||||
function_requires< TrivialIteratorConcept<TT> >();
|
function_requires< AssignableConcept<TT> >();
|
||||||
// require iterator_traits typedef's
|
function_requires< EqualityComparableConcept<TT> >();
|
||||||
|
TT j(i);
|
||||||
|
(void)*i; // require dereference operator
|
||||||
#ifndef BOOST_NO_STD_ITERATOR_TRAITS
|
#ifndef BOOST_NO_STD_ITERATOR_TRAITS
|
||||||
|
// require iterator_traits typedef's
|
||||||
typedef typename std::iterator_traits<TT>::difference_type D;
|
typedef typename std::iterator_traits<TT>::difference_type D;
|
||||||
// Hmm, the following is a bit fragile
|
// Hmm, the following is a bit fragile
|
||||||
//function_requires< SignedIntegerConcept<D> >();
|
//function_requires< SignedIntegerConcept<D> >();
|
||||||
@@ -572,7 +553,7 @@ struct require_same { typedef T type; };
|
|||||||
typedef typename std::iterator_traits<TT>::iterator_category C;
|
typedef typename std::iterator_traits<TT>::iterator_category C;
|
||||||
function_requires< ConvertibleConcept<C, std::input_iterator_tag> >();
|
function_requires< ConvertibleConcept<C, std::input_iterator_tag> >();
|
||||||
#endif
|
#endif
|
||||||
++i; // require preincrement operator
|
++j; // require preincrement operator
|
||||||
i++; // require postincrement operator
|
i++; // require postincrement operator
|
||||||
}
|
}
|
||||||
TT i;
|
TT i;
|
||||||
|
Reference in New Issue
Block a user