Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7942 Discussions

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

Alexander_T_
Beginner
378 Views

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....."
[cpp] #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 [/cpp]

0 Kudos
2 Replies
Alexander_T_
Beginner
378 Views

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

Here is the corrected version:

[cpp]#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
[/cpp]

0 Kudos
SergeyKostrov
Valued Contributor II
378 Views
>>...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.
0 Kudos
Reply