Skip to content

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

@nbooster

Description

@nbooster

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 ??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions