Is it possible to use std::any_cast without putting in the first template argument (the type of the object the any is covering)? I tried using any_cast<decltype(typeid(toCast).name())> but it didn't work.
Also tried to store the objects types from the beginning, but that also didn't work because variables can't store types.