Re: [Boost-bugs] [Boost C++ Libraries] #9293: multi_index_container iterator needs base object size

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9293: multi_index_container iterator needs base object size
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-10-23 15:29:44


#9293: multi_index_container iterator needs base object size
-------------------------------+-----------------------------
  Reporter: anonymous | Owner: joaquin
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: multi_index
   Version: Boost 1.46.0 | Severity: Problem
Resolution: wontfix | Keywords: multi_index_set
-------------------------------+-----------------------------

Comment (by joaquin):

 ''I understand, I didn't know about the completeness requirement, I
 thought I could just blindly replace std::list.''

 In fact, if my memory serves me well there's no standard requirement that
 `std::list` can be instantiated with incomplete types, you happen to be
 using an stdlib implementation providing this nice-to-have feature.

 ''Now I wonder, how is iterator_to implemented? Is there a hidden index,
 indexed by address?''

 There's no black magic here. `iterator_to` is used in the following
 context:
 {{{
 iterator it=c.iterator_to(*p);
 }}}
 So, you are providing the function with the node ''and'' the container it
 belongs to, this is all the info required to construct the iterator (not
 in a general case, but it happens to be so in Boost.MultiIndex.)

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9293#comment:4>
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:14 UTC