I have a variable with the following type:
std::variant<std::monostate, first_custom_type, second_custom_type> var;
where both first_custom_type and second_custom_type have a function called func() which I want to execute after creating var.
Is there a way to just call func() without having to check what type var is holding (e.g., with std::get)?