Check if STD::map key and value are a certain type

Jun 17, 2020 at 9:30pm
I have a std::map<std::string, std::shared_ptr<LaunchData>>. How can I check if the map passed into my template method holds a string for the keys and a shared ptr to launchData's objs for the values? This will help me check for invalid calls to the method that would otherwise break the code if uncaught.
Jun 17, 2020 at 10:39pm
How can I check if the map passed into my template method holds a string for the keys and a shared ptr to launchData's objs for the values?

If you require that an argument is a specific type, its type shouldn't be parametrized at all.
void f(std::map<std::string, std::shared_ptr<LaunchData>>);
Last edited on Jun 17, 2020 at 10:39pm
Topic archived. No new replies allowed.