[Boost.Intrusive] Compilation error with Visual Studio 2008

Hello,
For a project, I created a class allowing to reference some objects, and I
use Boost.Intrusive.
I started coding this class using Code::Blocks and gcc 3.4.5 . But now I
want to use Visual Studio 9, and I simply added the class to the project.
And then... it doesn't compile...
The code is here :
-----------------------------------------------------------------------------------------------------------------------------------------
#ifndef _BASE_EQUALREFSYSTEM_H_
#define _BASE_EQUALREFSYSTEM_H_
#include

AMDG info-tibo wrote:
For a project, I created a class allowing to reference some objects, and I use Boost.Intrusive. I started coding this class using Code::Blocks and gcc 3.4.5 . But now I want to use Visual Studio 9, and I simply added the class to the project. And then... it doesn't compile...
The code is here : ----------------------------------------------------------------------------------------------------------------------------------------- <snip> -----------------------------------------------------------------------------------------------------------------------------------------
VCC told me 42 errors, all related to the first one: line 112 : C2327: 'base::EqualRefSystem::ERSMemberHook' : is not a type name, static, or enumerator
I think that MSVC is wrong here by 3.3.6. You can work around this by using a base hook instead of a member hook. In Christ, Steven Watanabe

Hello,
For this class I can't use base hooks - except if there are no solutions
(for code design)...
I have another file with similar classes and a base hook, and it works,
apparently because the list is defined in another class than in the class of
the hook
i.e, the following works flawlessly:
class A {
public:
BaseHookType hook;
}
class B {
public:
List
AMDG
info-tibo wrote:
For a project, I created a class allowing to reference some objects, and I use Boost.Intrusive. I started coding this class using Code::Blocks and gcc 3.4.5 . But now I want to use Visual Studio 9, and I simply added the class to the project. And then... it doesn't compile...
The code is here : ----------------------------------------------------------------------------------------------------------------------------------------- <snip> -----------------------------------------------------------------------------------------------------------------------------------------
VCC told me 42 errors, all related to the first one: line 112 : C2327: 'base::EqualRefSystem::ERSMemberHook' : is not a type name, static, or enumerator
I think that MSVC is wrong here by 3.3.6. You can work around this by using a base hook instead of a member hook.
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

AMDG info-tibo wrote:
For this class I can't use base hooks - except if there are no solutions (for code design)...
I have another file with similar classes and a base hook, and it works, apparently because the list is defined in another class than in the class of the hook i.e, the following works flawlessly: class A { public: BaseHookType hook; } class B { public: List
lst; } Are there really no solutions to use member_hook
Apparently it works if you add an extra level of indirection:
template<class>
struct make_member_hook {
typedef
boost::intrusive::member_hook

It work perfectly, thanks a lot! Darktib
Apparently it works if you add an extra level of indirection:
template<class> struct make_member_hook { typedef boost::intrusive::member_hook
type; }; //! Objects that reference this EqualRefSystem boost::intrusive::list< EqualRefSystem, typename make_member_hook<EqualRefSystem>::type, boost::intrusive::constant_time_size<false> > ReferencedBy;
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
info-tibo
-
Steven Watanabe