The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.c++
From: bartek szurgot <b...@no.spam>
Date: Mon, 12 Nov 2012 18:00:31 +0100
Local: Mon, Nov 12 2012 12:00 pm
Subject: Re: operator[] in std::map
On 11/11/2012 10:23 PM, Ian Collins wrote:
> On 11/12/12 10:20, Fab wrote:
indeed. there is one more drawback - operator[] requires that "value" is
>> Dear all >> I use std::map for some application. I would like to return a const
>> const value& getValue( const int i ) const
>> where myMap is of type std::map. When I compile this with gcc, I get an
> Map's operator[] isn't const. It will modify the map (by inserting a
default constructable (because of reasons described above). -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||