Ticket #4623 (closed Patches: invalid)
at() member function to ordered_index/hashed_index
|Reported by:||Akira Takahashi <faithandbrave@…>||Owned by:||joaquin|
|Milestone:||To Be Determined||Component:||multi_index|
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.