# Class AnyId reference ## Description The template class `AnyId` can be used as the event ID type in `EventDispatcher` and `EventQueue`, then any types can be used as the event type. For example, ```c++ eventpp::EventQueue, void()> eventQueue; eventQueue.appendListener(3, []() {}); // listener 1 eventQueue.appendListener(std::string("hello"), []() {}); // listener 2 eventQueue.dispatch(3); // trigger listener 1 eventQueue.dispatch(std::string("hello")); // trigger listener 2 ``` Note the `eventpp::AnyId<>` in the example code, it's an instantiation of `AnyId` with default template parameters. It's in the place of where an event type should be, such as int. Without `AnyId`, a typical EventQueue looks like, ```c++ eventpp::EventQueue eventQueue; eventQueue.appendListener(3, []() {}); // This doesn't compile because std::string can't be converted to int // eventQueue.appendListener(std::string("hello"), []() {}); ``` For an `int` event type, we can't use `std::string` as the event ID. With `AnyId` in previous example code, we can pass any types as the event ID. ## API reference ### Header eventpp/utilities/anyid.h ### Class AnyId template parameters ```c++ template