MCPcopy Create free account
hub / github.com/Tessil/ordered-map / hash_ptr

Class hash_ptr

tests/ordered_map_tests.cpp:1517–1530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1515 */
1516BOOST_AUTO_TEST_CASE(test_heterogeneous_lookups) {
1517 struct hash_ptr {
1518 std::size_t operator()(const std::unique_ptr<int>& p) const {
1519 return std::hash<std::uintptr_t>()(
1520 reinterpret_cast<std::uintptr_t>(p.get()));
1521 }
1522
1523 std::size_t operator()(std::uintptr_t p) const {
1524 return std::hash<std::uintptr_t>()(p);
1525 }
1526
1527 std::size_t operator()(const int* const& p) const {
1528 return std::hash<std::uintptr_t>()(reinterpret_cast<std::uintptr_t>(p));
1529 }
1530 };
1531
1532 struct equal_to_ptr {
1533 using is_transparent = std::true_type;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected