|
Boost Users : |
Subject: Re: [Boost-users] [Unordered] No operator[] const?
From: Cory Nelson (phrosty_at_[hidden])
Date: 2010-09-12 20:28:45
On Sun, Sep 12, 2010 at 4:51 PM, Hossein Haeri <powerprogman_at_[hidden]> wrote:
> Dear all,
>
> Is there any specific reason why there is no operator[] const for boost::unordered_map? Or, is that only an oversight?
>
Like map<>, operator[] inserts if the key doesn't already exist, so a
const version won't work. You need to use find().
-- Cory Nelson http://int64.org
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net