forked from boostorg/iterator
Added test to detect category problem.
[SVN r1289]
This commit is contained in:
@@ -155,6 +155,8 @@ public:
|
|||||||
in_iterator(boost::input_iterator_archetype<T> d) : super_t(d) { }
|
in_iterator(boost::input_iterator_archetype<T> d) : super_t(d) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class T> struct undefined;
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
@@ -194,6 +196,11 @@ main()
|
|||||||
typedef ptr_iterator<int const> Iter1;
|
typedef ptr_iterator<int const> Iter1;
|
||||||
BOOST_STATIC_ASSERT((boost::is_same<Iter1::value_type, int>::value));
|
BOOST_STATIC_ASSERT((boost::is_same<Iter1::value_type, int>::value));
|
||||||
BOOST_STATIC_ASSERT((boost::is_same<Iter1::reference, const int&>::value));
|
BOOST_STATIC_ASSERT((boost::is_same<Iter1::reference, const int&>::value));
|
||||||
|
|
||||||
|
BOOST_STATIC_ASSERT((boost::is_same<Iter1::iterator_category::returns, boost::readable_lvalue_iterator_tag>::value));
|
||||||
|
|
||||||
|
undefined<Iter1::iterator_category> un;
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
||||||
// Borland has known problems with const
|
// Borland has known problems with const
|
||||||
BOOST_STATIC_ASSERT((boost::is_same<Iter1::pointer, const int*>::value));
|
BOOST_STATIC_ASSERT((boost::is_same<Iter1::pointer, const int*>::value));
|
||||||
|
Reference in New Issue
Block a user