Comparison helper for DataVector/List
classes.
More...
Public Types | |
typedef DVL::BaseContainer::value_type | inptr |
Public Member Functions | |
Compwrapper (Compare comp) | |
bool | operator() (inptr x, inptr y) |
Public Attributes | |
Compare | m_comp |
Comparison helper for DataVector/List
classes.
When doing operations such as sort
on a DataVector/List
, we'd like to be able to give to sort the iterators of the underlying BaseContainer
container, for the sake of efficiency. But we also have to make sure that the comparisons see the proper pointer types for derived DataVector/List
classes. This can be done with the following functional wrapper. This wraps a comparison object, putting the arguments through DVLCast
before calling the comparison.
There is also a specialization for the case where no casting is required.