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_)
55 value_type old_value = current;
57 while (!input.empty() && (binary_pred(current = *input, old_value)))
63 const value_type & operator * ()
const 69 const value_type * operator -> ()
const 84 template <
class Input>
85 class unique<Input, dummy_cmp_unique_>
88 typename Input::value_type current;
94 unique(Input & input_) : input(input_)
103 value_type old_value = current;
105 while (!input.empty() && ((current = *input) == old_value))
111 const value_type & operator * ()
const 117 const value_type * operator -> ()
const 125 return input.empty();
132 __STXXL_END_NAMESPACE
134 #endif // !STXXL_STREAM__UNIQUE_H Input::value_type value_type
Standard stream typedef.
Definition: unique.h:44
Stream package subnamespace.
Definition: choose.h:23
Equivalent to std::unique algorithms.
Definition: unique.h:36
bool empty() const
Standard stream method.
Definition: unique.h:75