How do you know the duplicate key insertion in STL map
-
Is there any way to indiccate the insertion of duplicate key in STL map babu.p
-
Is there any way to indiccate the insertion of duplicate key in STL map babu.p
sarath_babu wrote:
Is there any way to indiccate the insertion of duplicate key in STL map
You should ask this in the VC++ forum :- VC++ forum[^]
-
sarath_babu wrote:
Is there any way to indiccate the insertion of duplicate key in STL map
You should ask this in the VC++ forum :- VC++ forum[^]
Nish, C++/CLI is just plain too confusing for people. Most non MFC C++ questions seem to end up in here nowadays. Christian Graus - Microsoft MVP - C++
-
Nish, C++/CLI is just plain too confusing for people. Most non MFC C++ questions seem to end up in here nowadays. Christian Graus - Microsoft MVP - C++
Christian Graus wrote:
Nish, C++/CLI is just plain too confusing for people. Most non MFC C++ questions seem to end up in here nowadays.
Uhm, if a guy cannot differentiate between MFC and C++/CLI, it's worth asking the question as to whether he's ready for either (MFC or C++/CLI). -- modified at 12:51 Tuesday 15th November, 2005
-
Christian Graus wrote:
Nish, C++/CLI is just plain too confusing for people. Most non MFC C++ questions seem to end up in here nowadays.
Uhm, if a guy cannot differentiate between MFC and C++/CLI, it's worth asking the question as to whether he's ready for either (MFC or C++/CLI). -- modified at 12:51 Tuesday 15th November, 2005
The point is that most people don't know what C++/CLI *means*, they assume it's a general C++ forum, as opposed to the Visual C++ forum, which they assume is for MFC and other 'visual' stuff. That's my observation, I learned ages ago to look in here every day, even though I know very little about CLI. Christian Graus - Microsoft MVP - C++
-
The point is that most people don't know what C++/CLI *means*, they assume it's a general C++ forum, as opposed to the Visual C++ forum, which they assume is for MFC and other 'visual' stuff. That's my observation, I learned ages ago to look in here every day, even though I know very little about CLI. Christian Graus - Microsoft MVP - C++
Why on earth would a query about the C++ standard template library aka STL be in the microsoft foundation class or visual C++ forum? :confused: I doubt that Alexander Stepanov and Meng Lee at Hewlett-Packard in Palo Alto, California, Dave Musser at General Electric's Research Center in Schenectady, New York, Andrew Koenig, and of course "Mr C++" himself, Bjarne Stroustrup at AT&T Bell Laboratories would put such a query in a MS forum? And rather than give out a terse (bordering on rude) reply like Nish's why not suggest an answer and if it genuinely belongs in another forum educate the user so? Dissapointed I am :(
-
sarath_babu wrote:
Is there any way to indiccate the insertion of duplicate key in STL map
You should ask this in the VC++ forum :- VC++ forum[^]
You have to test!:) A STL map can only store one value per key. If you use a second instance of the key it will supercede the existing one. If this is not intended then you should use a multimap. You can see if a key is pre-existing by using the maps own find method and comaparing the result with the map's end iterator. If it reaches the end it isnt in the map :doh:
map::iterator it
it = some_map_or_other.find( the_key );
if ( it != some_map_or_other.end() ) {
//the key exists
}further, you can test if an item already exists in a map with the single arguement version of insert. This method returns a STL pair cpnsisting of an iterator & a bool. Now if the insertion was unsuccesful the bool will be false and the iterator will be at the duplicate key. hope this helps? -- modified at 8:46 Thursday 24th November, 2005
-
Why on earth would a query about the C++ standard template library aka STL be in the microsoft foundation class or visual C++ forum? :confused: I doubt that Alexander Stepanov and Meng Lee at Hewlett-Packard in Palo Alto, California, Dave Musser at General Electric's Research Center in Schenectady, New York, Andrew Koenig, and of course "Mr C++" himself, Bjarne Stroustrup at AT&T Bell Laboratories would put such a query in a MS forum? And rather than give out a terse (bordering on rude) reply like Nish's why not suggest an answer and if it genuinely belongs in another forum educate the user so? Dissapointed I am :(
i do agree perfectly... so here comes my question : why do you continue the thread instead of ignoring it ? if you don't agree with some things, use the voting to express your feeling about that... (which is what i am going to do now :D )
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
Why on earth would a query about the C++ standard template library aka STL be in the microsoft foundation class or visual C++ forum? :confused: I doubt that Alexander Stepanov and Meng Lee at Hewlett-Packard in Palo Alto, California, Dave Musser at General Electric's Research Center in Schenectady, New York, Andrew Koenig, and of course "Mr C++" himself, Bjarne Stroustrup at AT&T Bell Laboratories would put such a query in a MS forum? And rather than give out a terse (bordering on rude) reply like Nish's why not suggest an answer and if it genuinely belongs in another forum educate the user so? Dissapointed I am :(
Jeremy Thornton wrote:
Why on earth would a query about the C++ standard template library aka STL be in the microsoft foundation class or visual C++ forum?
Because the STL forum also caters to ATL and WTL, yet is a ghost town ? A lot of people do not know what CLI is, and assume that this forum is for 'standard C++' questions.
Jeremy Thornton wrote:
I doubt that Alexander Stepanov and Meng Lee at Hewlett-Packard in Palo Alto, California, Dave Musser at General Electric's Research Center in Schenectady, New York, Andrew Koenig, and of course "Mr C++" himself, Bjarne Stroustrup at AT&T Bell Laboratories would put such a query in a MS forum?
Who gives a toss what they would do ? People who are learning C++ are now required to understand it well enough to know which bits are STL before they are allowed to ask for help ? Christian Graus - Microsoft MVP - C++
-
Jeremy Thornton wrote:
Why on earth would a query about the C++ standard template library aka STL be in the microsoft foundation class or visual C++ forum?
Because the STL forum also caters to ATL and WTL, yet is a ghost town ? A lot of people do not know what CLI is, and assume that this forum is for 'standard C++' questions.
Jeremy Thornton wrote:
I doubt that Alexander Stepanov and Meng Lee at Hewlett-Packard in Palo Alto, California, Dave Musser at General Electric's Research Center in Schenectady, New York, Andrew Koenig, and of course "Mr C++" himself, Bjarne Stroustrup at AT&T Bell Laboratories would put such a query in a MS forum?
Who gives a toss what they would do ? People who are learning C++ are now required to understand it well enough to know which bits are STL before they are allowed to ask for help ? Christian Graus - Microsoft MVP - C++
I'm sorry my views drove you to angry expletive I have tried to move what I thought was an important topic to the suggestions forum.
Christian Graus wrote:
People who are learning C++ are now required to understand it well enough to know which bits are STL before they are allowed to ask for help ?
No that is the opposite of what I had intended to convey.