I'm very new to c++ and I can't believe I can't find a simple answer whether it is possible to call a function having a template as argument, without having to initialize that template first.
I'd like to be able to call my function directly such as:
#include <map>
#include <string>
void foo(std::multimap<std::string, int> &bar)
{
...
}
int main(int ac, const char *av[])
{
foo({{"hello", 1}, {"bye", 2}});
return (0);
}
Is there a way to do this in c++?