# Argument adapter reference ## Description The header file `eventpp/utilities/argumentadapter.h` contains utilities that can cast pass-in argument types to the types of the functioning being called. It's as if the argument types are casted using `static_cast` for most types or `static_pointer_cast` for shared pointers. For example, ```c++ struct Event { }; struct MouseEvent : public Event { }; eventpp::EventDispatcher dispatcher; // Below line won't compile because the listener parameter `const Event &` can't be converted to `const MouseEvent &` explicitly. //dispatcher.appendListener(ON_MOUSE_DOWN, [](const MouseEvent &) {}); // This line works. dispatcher.appendListener(ON_MOUSE_DOWN, eventpp::argumentAdapter([](const MouseEvent &) {})); ``` Note: above code may not work with `EventQueue`, because `EventQueue` stores the arguments in memory, here is `Event`. Passing `MouseEvent` will be stored as `Event`. `std::shared_ptr` should be used in `EventQueue`. See the sample code `example3` in this document. ## Header eventpp/utilities/argumentadapter.h ## API reference ```c++ template