|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2005-07-04 07:37:55
Jürgen Hunold <hunold_at_[hidden]> writes:
> Hi !
>
> I'm getting
>
> e:\libraries\boost_cvs\boost\pending\relaxed_heap.hpp(49) : warning
> C4355: 'this' : used in base member initializer list
>
> when compiling some files using the BGL.
> Nasty full output zipped attached.
>
> A quick and dirty fix is attached.
> But I have the feeling there might be a better way to solve this.
>
> Comments ?
Silence the compiler warning with #pragmas. There's nothing wrong
with the original code, and moving initialization out of the
base/member initialization list is very dangerous. I think this is a
bad warning because it will tempt the inexperienced to do just what
you did.
> cvs -z3 -q diff relaxed_heap.hpp (in directory D:\dev\boost_cvs\boost\pending)
> Index: relaxed_heap.hpp
> ===================================================================
> RCS file: /cvsroot/boost/boost/boost/pending/relaxed_heap.hpp,v
> retrieving revision 1.9
> diff -r1.9 relaxed_heap.hpp
> 49c49,52
> < : kind(kind), parent(this), rank(0) { }
> ---
>> : kind(kind), rank(0)
>> {
>> parent = this;
>> }
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk