#include <iostream>
#include <string>
#include <unordered_set>

struct Movie{
    std::string name;
    int year;
    
    Movie(std::string n, int y): name(std::move(n)), year(y)
    {
    }
    
    bool operator ==(const Movie &m) const
    {
        return year == m.year && name == m.name;
    };
};


namespace std
{
    template <>
    struct hash<Movie>
    {
        size_t operator()(const Movie& movie) const
        {
            return hash<std::string>{}(movie.name + to_string(movie.year));
        }
    };
}
////////////////////

struct ActorNode
{
    std::string name;
    std::unordered_set<Movie> movies;
    
    ActorNode(std::string n) : name(std::move(n))
    {
    }
    
    bool operator ==(const ActorNode &other) const
    {
        return name == other.name;
    }
};


namespace std
{
    template <>
    struct hash<ActorNode>
    {
        size_t operator()(const ActorNode& actor) const
        {
            return hash<std::string>{}(actor.name);
        }
    };
}
////////////////////


int main()
{
    std::unordered_set<ActorNode> actors;
    actors.emplace("Gene Wilder");
    
    auto itr = actors.find(ActorNode("Gene Wilder"));
    if (itr != actors.end())
    {
        // error, no such method 'insert'
        itr->movies.insert(Movie("Stir Crazy", 1981));
    }
}
