boost icon indicating copy to clipboard operation
boost copied to clipboard

Intrusive list iterator declaration for incomplete type does not compile (std::list and boost::container::list do)...

Open nbooster opened this issue 4 months ago • 2 comments

Hello,

I just want to ask if there is a way to make this code compile:

// example.hpp
#include <list>
#include <boost/container/list.hpp>
#include <boost/intrusive/list.hpp>

class LL;

class O
{
    std::list<LL>::iterator stlIt;
    boost::container::list<LL>::iterator boostIt;
    // uncommenting this line the code does not compile...
    // boost::intrusive::list<LL>::iterator boostIntrusiveIt;
};

class OL
{
    O member;
};

class L
{
    OL member;
};

class LL
{
    L member;
    boost::intrusive::list_member_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>> listHook_;
};

g++ 15.2.0 (Boost 1.88)...

The normal list iterators seem to be OK, but the intrusive one is not...

*What about SCARY iterators ( https://www.boost.org/doc/libs/1_70_0/doc/html/intrusive/boost_intrusive_iterators.html ) ? **How fast is this: s_iterator_to ??

nbooster avatar Sep 30 '25 13:09 nbooster

I suggest taking this question over to boostorg/intrusive. This doesn't seem like the right place for this issue.

nigels-com avatar Oct 31 '25 10:10 nigels-com

I just did... Although here is going to be seen by more people... Anyway, you can close the issue if you like...

nbooster avatar Oct 31 '25 10:10 nbooster