473,404 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

error using multiset insert and C++

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\include\functional(139): error C2784: 'bool std::operator <(const
std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : could not deduce
template argument for 'const std::_Tree<_Traits> &' 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;
}
Jul 21 '05 #1
0 1363

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Harrison | last post by:
If you insert equal values into a multiset is it specified what order they will have in the multiset. For instance, what should be the output of this program, is it defined? #include <set>...
2
by: gacek | last post by:
I can't find a clear example showing me how to use multiset with a custom compare function. (like here: http://www.codeproject.com/vcpp/stl/setandmap.asp - I have no idea why they have the 'struct...
0
by: joeboatertx | last post by:
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,...
5
by: Dale Marchand | last post by:
I'm trying to use an object in two different multiset containers, each with it's own sort method. For the most frequently used, I overrode the operator< method in the class, and for the second I...
2
by: =?iso-8859-1?q?Jo=E3o_Correia?= | last post by:
class CScore { public: int L; int C; CScore(int l, int c) { L = l; C = c;
9
by: neil.johnston | last post by:
I have a cut down example program that uses multiset to order some data. The data arrives from various sources and has a time stamp, data with identical timestamps can arrive and due to fifo's and...
2
by: parvtb | last post by:
Thanks for your patience to read the entire post to understand my confusion I have the user-defined class "tools": class tools{ public: tools( ......) {} friend bool operator<...
4
Digital Don
by: Digital Don | last post by:
Hi, I was looking at the MultiSet STL structure with some "less" keyword. I was told that we can use the "MultiSet" STL structure to automatically sort the content. Is it possible to store and...
3
by: subramanian100in | last post by:
Consider the following program: #include <cstdlib> #include <iostream> #include <set> #include <map> #include <algorithm> #include <iterator> #include <utility>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.