Utility to use Pattern types in std hash-containers
| 41 | |
| 42 | // Utility to use Pattern types in std hash-containers |
| 43 | struct PatternHasher { |
| 44 | template <typename P> |
| 45 | size_t operator()(std::shared_ptr<P> const& pattern) const { |
| 46 | return pattern->hash(); |
| 47 | } |
| 48 | template <typename P> |
| 49 | size_t operator()(P const* pattern) const { |
| 50 | return pattern->hash(); |
| 51 | } |
| 52 | template <typename P> |
| 53 | size_t operator()(P const& pattern) const { |
| 54 | return pattern.hash(); |
| 55 | } |
| 56 | }; |
| 57 | |
| 58 | // Utility to use 'hash' as the equality operator as well in std containers |
| 59 | struct PatternPointerEquality { |
nothing calls this directly
no outgoing calls
no test coverage detected