1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-28 20:44:26 +01:00

Implemented std::hash specialization for HWAddress.

This commit is contained in:
Matias Fontanini
2013-05-04 20:09:32 -03:00
parent 2bb699dc97
commit 62740e8e64

View File

@@ -37,6 +37,7 @@
#include <iomanip>
#include <iostream>
#include <sstream>
#include "cxxstd.h"
namespace Tins {
/**
@@ -319,5 +320,16 @@ void HWAddress<n, Storage>::convert(const std::string &hw_addr,
}
}
}
}
} // namespace Tins
#if TINS_IS_CXX11
namespace std
{
template<size_t n>
struct hash<Tins::HWAddress<n>> {
size_t operator()(const Tins::HWAddress<n> &addr) const {
return std::hash<std::string>()(addr.to_string());
}
};
} // namespace std
#endif
#endif // TINS_HWADDRESS_H