Using std::any from C++17 allows for proper type handling in the parameter field, removing the need for casting to void* and then casting the void* to the desired type.