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 

publicaciones de 3 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

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.

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya