This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: initializer_list: const reference.


Thiago Farina wrote:

Hi,

Reading the source code of initializer_list, I saw that the
definition
of reference is:

typedef const _E& reference;

Why it was declared as const? Is there a reason for this? Also
already exists a const_reference with the same declaration.

Please keep me in the CC list, because I'm not subscribed to the
list yet.

The iterator and the const_iterator are both constants iterators, just like for some of the assosiative containers. That's just what the standard prescribes.



Bo Persson



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]