[BGL] [msvc] Warnings in pending/relaxed_heap.hpp

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 ? Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Institut für Verkehrswesen, Eisenbahnbau * voice: ++49 511 762-2529 ! und -betrieb, Universität Hannover * fax : ++49 511 762-3001 ! Appelstrasse 9a, D-30167 Hannover * hunold@ive.uni-hannover.de ! www.ive.uni-hannover.de

Jürgen Hunold <hunold@ive.uni-hannover.de> 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

On Jul 4, 2005, at 6:37 AM, Jürgen Hunold wrote:
Hi !
I'm getting
e:\libraries\boost_cvs\boost\pending\relaxed_heap.hpp(49) : warning C4355: 'this' : used in base member initializer list
I've silenced the warning with a #pragma. The code is correct; MSVC is being a bit too eager here. Doug

Hi Doug ! On Dinsdag 05 Juli 2005 13:54, Douglas Gregor wrote:
On Jul 4, 2005, at 6:37 AM, Jürgen Hunold wrote:
e:\libraries\boost_cvs\boost\pending\relaxed_heap.hpp(49) : warning C4355: 'this' : used in base member initializer list
I've silenced the warning with a #pragma. The code is correct; MSVC is being a bit too eager here.
Thanks ! This fixes a really annoying msvc warning... Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Institut für Verkehrswesen, Eisenbahnbau * voice: ++49 511 762-2529 ! und -betrieb, Universität Hannover * fax : ++49 511 762-3001 ! Appelstrasse 9a, D-30167 Hannover * hunold@ive.uni-hannover.de ! www.ive.uni-hannover.de
participants (3)
-
David Abrahams
-
Douglas Gregor
-
Jürgen Hunold