mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
added a test to make sure that the type set by the generator is really the
type used [SVN r9497]
This commit is contained in:
parent
3a39729b58
commit
26240403b0
@ -9,6 +9,10 @@
|
|||||||
|
|
||||||
#include <boost/iterator_adaptors.hpp>
|
#include <boost/iterator_adaptors.hpp>
|
||||||
#include <boost/pending/iterator_tests.hpp>
|
#include <boost/pending/iterator_tests.hpp>
|
||||||
|
#include <boost/static_assert.hpp>
|
||||||
|
|
||||||
|
class bar { };
|
||||||
|
void foo(bar) { }
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
@ -16,7 +20,6 @@ main()
|
|||||||
using boost::dummyT;
|
using boost::dummyT;
|
||||||
dummyT array[] = { dummyT(0), dummyT(1), dummyT(2),
|
dummyT array[] = { dummyT(0), dummyT(1), dummyT(2),
|
||||||
dummyT(3), dummyT(4), dummyT(5) };
|
dummyT(3), dummyT(4), dummyT(5) };
|
||||||
const int N = sizeof(array)/sizeof(dummyT);
|
|
||||||
typedef boost::iterator_adaptor<dummyT*,
|
typedef boost::iterator_adaptor<dummyT*,
|
||||||
boost::default_iterator_policies, dummyT> my_iter;
|
boost::default_iterator_policies, dummyT> my_iter;
|
||||||
my_iter mi(array);
|
my_iter mi(array);
|
||||||
@ -27,6 +30,8 @@ main()
|
|||||||
::reference<dummyT>
|
::reference<dummyT>
|
||||||
::iterator_category<std::input_iterator_tag> > iter_type;
|
::iterator_category<std::input_iterator_tag> > iter_type;
|
||||||
|
|
||||||
|
BOOST_STATIC_ASSERT((boost::is_same<iter_type::reference, dummyT>::value));
|
||||||
|
|
||||||
iter_type i(mi);
|
iter_type i(mi);
|
||||||
boost::input_iterator_test(i, dummyT(0), dummyT(1));
|
boost::input_iterator_test(i, dummyT(0), dummyT(1));
|
||||||
}
|
}
|
||||||
@ -40,7 +45,7 @@ main()
|
|||||||
::iterator_category<std::forward_iterator_tag>
|
::iterator_category<std::forward_iterator_tag>
|
||||||
::difference_type<std::ptrdiff_t> > adaptor_type;
|
::difference_type<std::ptrdiff_t> > adaptor_type;
|
||||||
|
|
||||||
adaptor_type i(mi);
|
adaptor_type i(array);
|
||||||
|
|
||||||
boost::input_iterator_test(i, dummyT(0), dummyT(1));
|
boost::input_iterator_test(i, dummyT(0), dummyT(1));
|
||||||
int zero = 0;
|
int zero = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user