Hmm. I use VC7.1 too. however I realize now that I made a typo in the
code I posted. :(
I had put the implementation in the header (hence the lack of scope for
unspecified_bool_type in my previous post), and then I needed no casts.
(And just made the split to .inl when posting).
Could you try that? I.e put this in OSGFieldContainerPtrImpl.h:
operator unspecified_bool_type() const
{
return !*this ? 0 : &FieldContainerPtrBase::_storeP;
}
/Marcus
Chad Austin wrote:
Hi all,
I had to change my copy to get it to build in VC7.1. Here's the diff:
inline
-FieldContainerPtrBase::operator unspecified_bool_type() const
+FieldContainerPtrBase::operator
FieldContainerPtrBase::unspecified_bool_type()
const
{
- return !*this ? 0 : (unspecified_bool_type)&_storeP;
+ return !*this ? 0 : &FieldContainerPtrBase::_storeP;
}
C-style casts (and most casts in general) smell bad. ;)
Chad
Marcus Lindblom wrote:
Dirk Reiners wrote:
Hi Marcus,
I had to change it a little bit (add a typecast) for gcc 3.4, let's see
what the dailybuild says for the other platforms. I'm not toally happy
with it (casting a pointer to a member to a pointer to method is
probably not a good idea, even if it's never going to be used), but it's
worth a try.
As I understand it, unspecified_bool_type is a pointer to a member (a
uint8-ptr in a fcptrbase object), not a method, as there are no
function call parenthesis in the definition of the type. Strange then,
that you should need a cast but boost doesn't need one (or perhaps one
of the other ifdef-cases are used for gcc).
/Marcus
-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to
collaborate
online with coworkers and clients while avoiding the high cost of
travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it
free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel
and
communications. There is no equipment to buy and you can meet as often as
you want. Try it
free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users