下面这段示例代码无法编译,我无法弄清楚如何将int
和tuple
插入到映射表中。
#include <tuple>
#include <string>
#include <map>
int main()
{
std::map<int, std::tuple<std::wstring, float, float>> map;
std::wstring temp = L"sample";
// ERROR: no instance of overloaded function matches the argument list
map.insert(1, std::make_tuple(temp, 0.f, 0.f));
return 0;
}
如何将示例int, std::tuple
正确地插入到map中?
int
,则会出现相同的错误。您认为应该调用哪个 insert 重载? - 463035818_is_not_a_number