52 lines
		
	
	
	
		
			945 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
	
		
			945 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <nano/boost/asio/ip/tcp.hpp>
 | |
| #include <nano/node/endpoint.hpp>
 | |
| 
 | |
| namespace std
 | |
| {
 | |
| template <>
 | |
| struct hash<::nano::endpoint>
 | |
| {
 | |
| 	std::size_t operator() (::nano::endpoint const & endpoint_a) const
 | |
| 	{
 | |
| 		endpoint_hash<sizeof (std::size_t)> ehash;
 | |
| 		return ehash (endpoint_a);
 | |
| 	}
 | |
| };
 | |
| 
 | |
| #ifndef BOOST_ASIO_HAS_STD_HASH
 | |
| template <>
 | |
| struct hash<boost::asio::ip::address>
 | |
| {
 | |
| 	std::size_t operator() (boost::asio::ip::address const & ip_a) const
 | |
| 	{
 | |
| 		ip_address_hash<sizeof (std::size_t)> ihash;
 | |
| 		return ihash (ip_a);
 | |
| 	}
 | |
| };
 | |
| #endif
 | |
| }
 | |
| 
 | |
| namespace boost
 | |
| {
 | |
| template <>
 | |
| struct hash<::nano::endpoint>
 | |
| {
 | |
| 	std::size_t operator() (::nano::endpoint const & endpoint_a) const
 | |
| 	{
 | |
| 		std::hash<::nano::endpoint> hash;
 | |
| 		return hash (endpoint_a);
 | |
| 	}
 | |
| };
 | |
| 
 | |
| template <>
 | |
| struct hash<boost::asio::ip::address>
 | |
| {
 | |
| 	std::size_t operator() (boost::asio::ip::address const & ip_a) const
 | |
| 	{
 | |
| 		std::hash<boost::asio::ip::address> hash;
 | |
| 		return hash (ip_a);
 | |
| 	}
 | |
| };
 | |
| }
 | 
