#include <iostream>
#include <string>
#include <boost/unordered_map.hpp>
#include <boost/functional/hash.hpp>

typedef enum
{
	P0 = 0,
	P1
} Mpol;

class MyClass {
public:
    MyClass(const std::string& data, Mpol number) : data(data), number(number) {}

    bool operator==(const MyClass& other) const {
        return data == other.data && number == other.number;
    }

    std::string data;
    Mpol number;
    
    // Define the hash function for MyClass
    friend std::size_t hash_value(const MyClass& obj) {
    std::size_t seed = 0;
    boost::hash_combine(seed, obj.data);
    boost::hash_combine(seed, obj.number);
    return seed;
}

};



int main() {
    // Create a boost::unordered_map with MyClass as the key and int as the value
    boost::unordered_map<MyClass, int> my_map;

    MyClass obj1("Hello, world!", P0);
    MyClass obj2("Goodbye, world!", P1);

    // Add key-value pairs to the boost::unordered_map
    my_map[obj1] = 1;
    my_map[obj2] = 2;

    // Access and print values in the boost::unordered_map
    std::cout << "Value for obj1: " << my_map[obj1] << std::endl;
    std::cout << "Value for obj2: " << my_map[obj2] << std::endl;

    return 0;
}
