mirror of
https://github.com/boostorg/utility.git
synced 2025-05-11 13:24:02 +00:00
added filter iterator test
[SVN r8736]
This commit is contained in:
parent
2470b53373
commit
6396fdb5ff
@ -71,6 +71,12 @@ struct select1st_
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct one_or_four {
|
||||||
|
bool operator()(dummyT x) const {
|
||||||
|
return x.foo() == 1 || x.foo() == 4;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
@ -170,6 +176,14 @@ main()
|
|||||||
boost::random_access_iterator_test(r.begin(), r.size(), int_array);
|
boost::random_access_iterator_test(r.begin(), r.size(), int_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test filter iterator
|
||||||
|
{
|
||||||
|
typedef boost::filter_iterator<one_or_four, dummyT*,
|
||||||
|
boost::iterator<std::forward_iterator_tag, dummyT, std::ptrdiff_t,
|
||||||
|
dummyT*, dummyT&> >::type FilterIter;
|
||||||
|
FilterIter i(array);
|
||||||
|
boost::forward_iterator_test(i, 1, 4);
|
||||||
|
}
|
||||||
std::cout << "test successful " << std::endl;
|
std::cout << "test successful " << std::endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user