2
votes

I am running below line of code from a function

string internalPath(os.str());
   m_tags.insert(make_pair<string, TagConfig >(internalPath, tagConfig ));
error: no matching function for call to ‘make_pair(std::string&, const wicom::TagConfig&)’
m_tags.insert(make_pair<string, TagConfig >(internalPath, tagConfig ));
                                                                    ^

Compiler g++=C++14

1

1 Answers

3
votes

You should never specify template arguments expicitly for std::make_pair—it is intended for deducing them, as it uses perfect forwarding. Either get rid of them:

m_tags.insert(make_pair(internalPath, tagConfig ));

or if you need to specify them explicitly, use std::pair directly:

m_tags.insert(pair<string, TagConfig >(internalPath, tagConfig ));

As a side note, you seem to have using namespace std; somewhere. I suggest you get rid of it, it's obfuscation more than anything else.