14 #ifndef STXXL_STREAM__UNIQUE_H
15 #define STXXL_STREAM__UNIQUE_H
17 #include <stxxl/bits/namespace.h>
20 __STXXL_BEGIN_NAMESPACE
29 struct dummy_cmp_unique_ { };
35 template <
class Input,
class BinaryPredicate = dummy_cmp_unique_>
39 BinaryPredicate binary_pred;
40 typename Input::value_type current;
46 unique(Input & input_, BinaryPredicate binary_pred_) : input(input_), binary_pred(binary_pred_)
57 while (!input.empty() && (binary_pred(current = *input, old_value)))
84 template <
class Input>
85 class unique<Input, dummy_cmp_unique_>
88 typename Input::value_type current;
94 unique(Input & input_) : input(input_)
105 while (!input.empty() && ((current = *input) == old_value))
125 return input.empty();
132 __STXXL_END_NAMESPACE
134 #endif // !STXXL_STREAM__UNIQUE_H