Menu

#81 Class members are often not properly initialized at construction

SNAP_3.0
open
nobody
None
1
2014-10-21
2014-10-21
Gert Wollny
No

In many cased the class members of certain classes are not properly initialized at construction time. Since the Set* method check these values to track the changes, the according if constructs compare to uninitialized values. (valgrind is an excellent tool to find such bugs.)
The attached patches fix some of these problems by properly initializing member variables at construction time.

The incentive to use initialization over assignment within the constructor comes from Sutter at al. (www.gotw.ca), #48.

2 Attachments

Discussion


Log in to post a comment.

MongoDB Logo MongoDB