libzypp: zypp-core/base/Hash.h File Reference

libzypp 17.38.13

Hash.h File Reference
`#include <iosfwd>`
`#include <unordered_set>`
`#include <unordered_map>`

Go to the source code of this file.

## Namespaces
namespace | std

## Macros
#define | ZYPP_DEFINE_ID_HASHABLE(C)
| Define hash function for id based classes.

## Functions
template<class D>
unordered_set< D > * | std::rwcowClone (const std::unordered_set< D > *rhs)
| clone function for RW_pointer
template<class K, class V>
std::unordered_map< K, V > * | std::rwcowClone (const std::unordered_map< K, V > *rhs)
| clone function for RW_pointer

## Macro Definition Documentation

## ◆ ZYPP_DEFINE_ID_HASHABLE

#define ZYPP_DEFINE_ID_HASHABLE | ( |  | C | ) |

Value:
namespace std { \
template<class Tp> struct hash; \
template<> struct hash<C> \
{ \
size_t operator()( const C & __s ) const \
{ return __s.id(); } \
}; \
}
std
Definition ansi.h:855

Define hash function for id based classes.

Class has to provide a method `id()` retuning a unique number.

// in global namespace define:
ZYPP_DEFINE_ID_HASHABLE( ::zypp::sat::Solvable )
ZYPP_DEFINE_ID_HASHABLE
#define ZYPP_DEFINE_ID_HASHABLE(C)
Define hash function for id based classes.
Definition Hash.h:26
zypp::sat::Solvable
A Solvable object within the sat Pool.
Definition Solvable.h:54

Definition at line 26 of file Hash.h.