GEGELATI
Loading...
Searching...
No Matches
genericComparator.h
1
36#ifndef GENERIC_COMPARATOR_H
37#define GENERIC_COMPARATOR_H
38
39template <typename T>
42{
43
47 using is_transparent = void;
48
52 bool operator()(const std::unique_ptr<T>& a,
53 const std::unique_ptr<T>& b) const
54 {
55 return *a < *b;
56 }
57
62 bool operator()(const std::unique_ptr<T>& a, const T* b) const
63 {
64 return *a < *b;
65 }
66
71 bool operator()(const T* a, const std::unique_ptr<T>& b) const
72 {
73 return *a < *b;
74 }
75};
76
77#endif
A comparator for unique_ptr that compares the pointed-to values.
Definition genericComparator.h:42
bool operator()(const std::unique_ptr< T > &a, const T *b) const
Compare a unique_ptr and a raw pointer by comparing the pointed-to values.
Definition genericComparator.h:62
void is_transparent
Type alias to signal that this comparator is transparent.
Definition genericComparator.h:47
bool operator()(const std::unique_ptr< T > &a, const std::unique_ptr< T > &b) const
Compare two unique_ptr by comparing the pointed-to values.
Definition genericComparator.h:52
bool operator()(const T *a, const std::unique_ptr< T > &b) const
Compare a raw pointer and a unique_ptr by comparing the pointed-to values.
Definition genericComparator.h:71