#include <iostream>
#include <boost/unordered_map.hpp>

using namespace std;

#define PEERS_KEY

class peer_key_c
{
public:
        peer_key_c(int host, int uid)
        {
                host_ = host;
#ifdef PEERS_KEY
                uid_ = uid;
#else
                (void)uid;
#endif
        }

        bool operator==(peer_key_c v) const
        {
#ifdef PEERS_KEY
                return host_ == v.host_ && uid_ == v.uid_;
#else
                return host_ == v.host_;
#endif
        }

        bool operator<(peer_key_c v) const
        {
#ifdef PEERS_KEY
                return host_ < v.host_ || host_ == v.host_ && uid_ < v.uid_;
#else
                return host_ < v.host_;
#endif
        }

        friend std::size_t hash_value(const peer_key_c& v)
        {
                std::size_t seed = boost::hash_value(v.host_);
#ifdef PEERS_KEY
                boost::hash_combine(seed, v.uid_);
#endif
                return seed;
        }

        int host_;
#ifdef PEERS_KEY
        int uid_;
#endif
};

struct t_peer
{
        long long downloaded;
        long long uploaded;
        time_t mtime = 0;
        int uid;
        short port;
        bool left;
        std::array<char, 20> peer_id;
};

typedef boost::unordered_map<peer_key_c, t_peer> t_peers;

int main() {
	std::cout << "sizeof(t_peer) = " << sizeof(t_peer) << " bytes, total data size: " << sizeof(t_peer) * 10000 << " bytes" << std::endl;
	std::cout << "sizeof(peer_key_c) = " << sizeof(peer_key_c) << " bytes, total data size: " << sizeof(peer_key_c) * 10000 << " bytes" << std::endl;
	
	return 0;
}