Hi Serge,

On Thu, May 22, 2008 at 10:46 AM, Serge Lages <[EMAIL PROTECTED]> wrote:
> The current SVN doesn't compile under Windows :
> openscenegraph\src\osgdb\databasepager.cpp(910) : error C4716:
> 'osgDB::DatabasePager::setSchedulePriority' : must return a value

Now fixed and checked in.

> And there are some warnings :
>
> 3>.\DatabasePager.cpp(699) : warning C4355: 'this' : used in base member
> initializer list
> 3>.\DatabasePager.cpp(700) : warning C4355: 'this' : used in base member
> initializer list
> 3>.\DatabasePager.cpp(842) : warning C4355: 'this' : used in base member
> initializer list
> 3>.\DatabasePager.cpp(843) : warning C4355: 'this' : used in base member
> initializer list

Ack, this is a more awkward one, I've deliberately gone for this
design of passing in the pointer
to the parent object to avoid potential for the pointer not being set
and introduce a bug...

If the compiler is complaining about:

DatabasePager::DatabasePager(const DatabasePager& rhs):
    _fileRequestQueue(this,"fileRequestQueue"),
    _httpRequestQueue(this,"httpRequestQueue")
{..
}

Then it could be fixed by moving the initialization of the objects
into the constructor {} rather than the initializer list, but this
isn't as robust code wise.

But is this warning suggesting that the "this" pointer might not be
fully formed by the time one gets into the initializer list?  I would
have thought this would not be the case, as the compile must know the
objects size and position in memory before it starts calling
initializers on that memory.   Or is the compiler just trying to catch
people of dereferencing the this pointer before the parent object has
been constructed??

Robert.

Robert.



    _fileRequestQueue(this,"fileRequestQueue"),
    _httpRequestQueue(this,"httpRequestQueue")

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to