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 06:12:21


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

 * status: new => closed
 * type: Bugs => Feature Requests
 * resolution: => wontfix

Comment:

 Hi,

 The reason your example fails to compile is that `multi_index_container`
 does not work on so-called incomplete types, i.e. it needs to know the
 size of the element type at instantiation time. This is not a bug per se,
 although the ability to work with incomplete types is of course a
 desireable one.

 Unfortunately I don't expect adding this capability any time soon as it
 needs some heavy refactoring I don't have currently the time for. Maybe
 you can replace your code with

 {{{
 struct A;
 struct B {
   const A* a_p;
 };
 struct A {
   const B* b_p;
 };
 }}}
 and use `iterator_to` to retrieve an iterator from a pointer when needed:

 http://www.boost.org/libs/multi_index/doc/tutorial/indices.html#iterator_to

 Let me know if that works for you.

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