28 template<
typename T,
bool mayBeNull = true>
36 template<
typename T,
bool mayBeNull>
43 if (lhs ==
nullptr || rhs ==
nullptr) {
47 assert(lhs !=
nullptr);
48 assert(rhs !=
nullptr);
49 return std::equal_to<T>()(*lhs, *rhs);
53 template<
typename T,
bool mayBeNull>
54 struct equal_to<std::shared_ptr<T>, mayBeNull> {
55 bool operator()(
const std::shared_ptr<const T>& lhs,
const std::shared_ptr<const T>& rhs)
const {
60 if (lhs ==
nullptr || rhs ==
nullptr) {
64 return std::equal_to<T>()(*lhs, *rhs);
68 template<
typename T,
bool mayBeNull = true>
70 std::not_equal_to<T>
neq;
76 template<
typename T,
bool mayBeNull>
83 template<
typename T,
bool mayBeNull>
85 bool operator()(
const std::shared_ptr<const T>& lhs,
const std::shared_ptr<const T>& rhs)
const {
96 template<
typename T,
bool mayBeNull = true>
100 return _less(lhs, rhs);
104 template<
typename T,
bool mayBeNull>
112 if (lhs ==
nullptr || rhs ==
nullptr) {
113 return lhs ==
nullptr;
116 return _less(*lhs, *rhs);
120 template<
typename T,
bool mayBeNull>
121 struct less<std::shared_ptr<T>, mayBeNull> {
123 bool operator()(
const std::shared_ptr<const T>& lhs,
const std::shared_ptr<const T>& rhs)
const {
128 if (lhs ==
nullptr || rhs ==
nullptr) {
129 return lhs ==
nullptr;
132 return _less(*lhs, *rhs);
136 template<
typename T,
bool mayBeNull = true>
144 template<
typename T,
bool mayBeNull>
151 template<
typename T,
bool mayBeNull>
152 struct greater<std::shared_ptr<T>, mayBeNull> {
153 bool operator()(
const std::shared_ptr<const T>& lhs,
const std::shared_ptr<const T>& rhs)
const {
163 template<
typename T,
bool mayBeNull = true>
167 return _hash(lhs, rhs);
171 template<
typename T,
bool mayBeNull>
179 return std::hash<T>()(*t);
183 template<
typename T,
bool mayBeNull>
184 struct hash<std::shared_ptr<T>, mayBeNull> {
191 return std::hash<T>()(*t);
carl is the main namespace for the library.
Alternative specialization of std::equal_to for pointer types.
bool operator()(const T &lhs, const T &rhs) const
bool operator()(const T *lhs, const T *rhs) const
bool operator()(const std::shared_ptr< const T > &lhs, const std::shared_ptr< const T > &rhs) const
std::not_equal_to< T > neq
bool operator()(const T &lhs, const T &rhs) const
bool operator()(const T *lhs, const T *rhs) const
bool operator()(const std::shared_ptr< const T > &lhs, const std::shared_ptr< const T > &rhs) const
Alternative specialization of std::less for pointer types.
bool operator()(const T &lhs, const T &rhs) const
bool operator()(const T *lhs, const T *rhs) const
bool operator()(const std::shared_ptr< const T > &lhs, const std::shared_ptr< const T > &rhs) const
bool operator()(const T &lhs, const T &rhs) const
std::greater< T > _greater
bool operator()(const T *lhs, const T *rhs) const
bool operator()(const std::shared_ptr< const T > &lhs, const std::shared_ptr< const T > &rhs) const
Alternative specialization of std::hash for pointer types.
bool operator()(const T &lhs, const T &rhs) const
std::size_t operator()(const T *t) const
std::size_t operator()(const std::shared_ptr< T > &t) const