Hi Robert,

Since I don't have a copy of the C++ standard, it wasn't clear to me
whether the default constructor for std::pair was required to
default-initialize built-in types so I played it safe and explicitly
initialized the pointers to null. I checked the std::pair
implementations shipped with Visual Studio 2008 and 2010 and found that
they both default-initialize std::pair members. GCC under Linux also
default-initializes the members so I presume MinGW would as well. So
even if not part of the official standard it seems safe to expect that
behavior for Windows builds where this code will be used.

Mark

On 11/10/2010 5:51 AM, Robert Osfield wrote:
Hi Windows dev's,

Could we have some feedback on my suggestion for simply using the
default std::pair<>  constructor?

Robert.

On Wed, Nov 3, 2010 at 10:17 AM, Robert Osfield
<[email protected]>  wrote:
Hi Guys,

I've just reviewed both of your proposed fixes and both seem rather
long winded.  I'd be inclined towards Mark's solution as it doesn't
rely on any optional compile paths.  I do wonder if one might just be
able to use a default constructed CapEntry as it's just typedef
std::pair<..>  and would std::pair's default constructor not just
initialize to 0 for us?

Robert.

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

This message and any attachments are solely for the intended recipient and may 
contain confidential or privileged information. If you are not the intended 
recipient, any disclosure, copying, use, or distribution of the information 
included in this message and any attachments is prohibited. If you have 
received this communication in error, please notify us by reply e-mail and 
immediately and permanently delete this message and any attachments. Thank you.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to