I have some simple C++ code I am trying to compile using VS.NET 2003.
(Below) Every time I try to compile I get numerous C2784 errors. If I
simply comment out both of the chores.insert() lines, the error goes away anf
the program runs normally. I am using the insert function incorrectly?
Error:
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\functional(13 9): error C2784: 'bool std::operator <(const
std::_Tree<_Tra its> &,const std::_Tree<_Tra its> &)' : could not deduce
template argument for 'const std::_Tree<_Tra its> &' from 'const std::string'
Code:
#include <iostream>
#include <set>
using namespace std;
int main()
{
multiset<string > chores;
multiset<string >::iterator fline;
chores.insert(" test2");
//chores.insert(" test3");
std::cout << "show text";
return 0;
}
(Below) Every time I try to compile I get numerous C2784 errors. If I
simply comment out both of the chores.insert() lines, the error goes away anf
the program runs normally. I am using the insert function incorrectly?
Error:
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\functional(13 9): error C2784: 'bool std::operator <(const
std::_Tree<_Tra its> &,const std::_Tree<_Tra its> &)' : could not deduce
template argument for 'const std::_Tree<_Tra its> &' from 'const std::string'
Code:
#include <iostream>
#include <set>
using namespace std;
int main()
{
multiset<string > chores;
multiset<string >::iterator fline;
chores.insert(" test2");
//chores.insert(" test3");
std::cout << "show text";
return 0;
}