Problem with compiling boost::intrusive::list with base_hook

Problem with compiling boost::intrusive::list with base_hook

Here is sample code, which compiles fine with both GCC and MSVC, but ICC 13.5 generates an error "error: invalid type conversion: "const B *" to "const boost::intrusive::detail::node_holder....."

 #include <boost/intrusive/list.hpp> class A { public: boost::intrusive::list>> m_list; }; //class B : public A, public boost::intrusive::list_base_hook<> {}; // to make possible compilation with icc, uncomment this line 

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

It seems this forum very dislike my code snippet. :)

Here is the corrected version:

#include <boost/intrusive/list.hpp>
class A
{
public:
    boost::intrusive::list<class B, boost::intrusive::base_hook<boost::intrusive::list_base_hook<>>> m_list;
};
//class B : public A, public boost::intrusive::list_base_hook<> {}; // to make possible compilation with icc, uncomment this line

>>...It seems this forum very dislike my code snippet. :)

There is some issue with Editor and it doesn't process correctly cases when #include ... directive is used. It is recommended to attach test codes instead.

Leave a Comment

Please sign in to add a comment. Not a member? Join today