mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
oops, meant to remove use of policies_type from filter_iterator_generator
in the last commit, but accidentally added it :( [SVN r9215]
This commit is contained in:
parent
ed3cbfdb8e
commit
de84fe8d98
@ -63,7 +63,6 @@ class filter_iterator_generator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef <tt><a href="./iterator_adaptors.htm#iterator_adaptor">iterator_adaptor</a><...></tt> type; // the resulting filter iterator type
|
typedef <tt><a href="./iterator_adaptors.htm#iterator_adaptor">iterator_adaptor</a><...></tt> type; // the resulting filter iterator type
|
||||||
typedef ... policies_type; // the policies type for the iterator adaptor
|
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
@ -81,11 +80,11 @@ int main() {
|
|||||||
int numbers[] = { 0, -1, 4, -3, 5, 8, -2 };
|
int numbers[] = { 0, -1, 4, -3, 5, 8, -2 };
|
||||||
const int N = sizeof(numbers)/sizeof(int);
|
const int N = sizeof(numbers)/sizeof(int);
|
||||||
|
|
||||||
typedef boost::filter_iterator_generator<is_positive_number, int*, int> Gen;
|
typedef boost::filter_iterator_generator<is_positive_number, int*, int>::type FilterIter;
|
||||||
is_positive_number predicate;
|
is_positive_number predicate;
|
||||||
Gen::policies_type policies(predicate, numbers + N);
|
FilterIter::policies_type policies(predicate, numbers + N);
|
||||||
Gen::type filter_iter_first(numbers, policies);
|
FilterIter filter_iter_first(numbers, policies);
|
||||||
Gen::type filter_iter_last(numbers + N, policies);
|
FilterIter filter_iter_last(numbers + N, policies);
|
||||||
|
|
||||||
std::copy(filter_iter_first, filter_iter_last, std::ostream_iterator<int>(std::cout, " "));
|
std::copy(filter_iter_first, filter_iter_last, std::ostream_iterator<int>(std::cout, " "));
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user