[graph] Uninitialized value copied due to missing member initialization in class property

I'm getting uninitialized memory errors in a program that uses Boost.Graph. This happens because add_edge(u, v, g) calls add_edge(u, v, p, g) copying a default constructed edge property. The no argument constructor for property in directory pending is: property() { } so if T is a primitive type it is left uninitialized. I think this should be changed to property() : m_value() { } Regards, Bruno

On Aug 27, 2006, at 12:12 PM, Bruno Martínez wrote:
I'm getting uninitialized memory errors in a program that uses Boost.Graph. This happens because add_edge(u, v, g) calls add_edge (u, v, p, g) copying a default constructed edge property. The no argument constructor for property in directory pending is:
property() { }
so if T is a primitive type it is left uninitialized. I think this should be changed to
property() : m_value() { }
Yes, you're right. This is fixed in Boost CVS for 1.34.0. Doug
participants (2)
-
Bruno Martínez
-
Douglas Gregor