Subject: [Boost-bugs] [Boost C++ Libraries] #4623: at() member function to ordered_index/hashed_index
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-09-03 03:43:55
#4623: at() member function to ordered_index/hashed_index
-------------------------------------------------------+--------------------
Reporter: Akira Takahashi <faithandbrave@â¦> | Owner: joaquin
Type: Patches | Status: new
Milestone: To Be Determined | Component: multi_index
Version: Boost 1.44.0 | Severity: Problem
Keywords: |
-------------------------------------------------------+--------------------
ordered_index/hashed_index don't have operator[]() and at() member
functions, those are inconsistent with std::map/boost::unordered_map. For
this reason find() member function need to be used to access an element in
ordered_index/hashed_index. It's annoying.
To solve this issue, I propose to implement at() member function to
ordered_index/hashed_index. operator[]() should not be added because it
will conflict with random_access. (patches to implement my proposal are
attached below)
According to the design of MultiIndex library, I've only implemented const
version of at() member function and left non-const version of at(), which
allows destructive change, unimplemented.
Although I think optional_at() member function which will report an error
by boost::optional looks useful, I haven't included it in this proposal
since error handling policy of MultiIndex library with using
boost::optional is undefined.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4623> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC