implemented a static dispatch system
The current system only supports limited dispatch due to C++14 limitations on closure types and constexpr for-loops.