7 #include <unordered_map>
11 template<
typename ObjWithId>
15 using T =
typename std::decay<typename std::remove_pointer<ObjWithId>::type>::type;
16 constexpr
bool operator()(
const T *
const lhs,
const T *
const rhs)
const
17 {
return lhs && rhs && lhs->id() < rhs->id(); }
18 constexpr
bool operator()(
const T & lhs,
const T & rhs)
const {
return lhs.id() < rhs.id(); }
21 template<
typename ObjWithId>
25 using T =
typename std::decay<typename std::remove_pointer<ObjWithId>::type>::type;
26 constexpr
bool operator()(
const T *
const lhs,
const T *
const rhs)
const
27 {
return lhs && rhs && lhs->id() == rhs->id(); }
28 constexpr
bool operator()(
const T & lhs,
const T & rhs)
const {
return lhs.id() == rhs.id(); }
31 template<
typename ObjWithId>
35 using T =
typename std::decay<typename std::remove_pointer<ObjWithId>::type>::type;
36 std::size_t
operator()(
const T * key)
const {
return key ? std::hash<int>()(key->id()) : std::hash<int>()(-1); }
37 std::size_t
operator()(
const T & key)
const {
return std::hash<int>()(key.id()); }
40 template<
typename KeyWithId,
typename Value,
typename Allocator = std::allocator<std::pair<const KeyWithId, Value>>>
41 using map = std::map<KeyWithId, Value, IdLess<KeyWithId>, Allocator>;
43 template<
typename KeyWithId,
typename Value,
typename Allocator = std::allocator<std::pair<const KeyWithId, Value>>>
typename std::decay< typename std::remove_pointer< ObjWithId >::type >::type T
Definition: map.h:35
std::size_t operator()(const T &key) const
Definition: map.h:37
std::size_t operator()(const T *key) const
Definition: map.h:36
constexpr bool operator()(const T &lhs, const T &rhs) const
Definition: map.h:28
constexpr bool operator()(const T *const lhs, const T *const rhs) const
Definition: map.h:26
typename std::decay< typename std::remove_pointer< ObjWithId >::type >::type T
Definition: map.h:25
constexpr bool operator()(const T &lhs, const T &rhs) const
Definition: map.h:18
constexpr bool operator()(const T *const lhs, const T *const rhs) const
Definition: map.h:16
typename std::decay< typename std::remove_pointer< ObjWithId >::type >::type T
Definition: map.h:15
Definition: AffineExprDetail.h:15
std::unordered_map< KeyWithId, Value, HashId< KeyWithId >, IdEqual< KeyWithId >, Allocator > unordered_map
Definition: map.h:44
std::map< KeyWithId, Value, IdLess< KeyWithId >, Allocator > map
Definition: map.h:41