[Boost-bugs] [Boost C++ Libraries] #10172: BOOST_STRONG_TYPEDEF missing default initialization of member value

Subject: [Boost-bugs] [Boost C++ Libraries] #10172: BOOST_STRONG_TYPEDEF missing default initialization of member value
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-07-02 14:17:24


#10172: BOOST_STRONG_TYPEDEF missing default initialization of member value
--------------------------------------+------------------------------
 Reporter: Christopher <kemsleyc@…> | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.55.0
 Severity: Problem | Keywords:
--------------------------------------+------------------------------
 This ticket already exists as #5182. That was resolved as fixed as of
 boost 1.44. However, both boost 1.54 and 1.55 currently exhibit this issue
 and does not show the fix.

 To copy the original description:

 The default constructor created by BOOST_STRONG_TYPEDEF should explicitly
 initialize its wrapped value in the default constructor. I.E.

 D() {};

 should be

 D() : t() {};

 This ensures that, in client code, D() is equivalent to t().


 Attached will be a test which currently prints:

 a.v1 = 0
 a.v2 = 140734601341608
 a.v1 = 1
 a.v2 = 2
 a.v1 = 0
 a.v2 = 2

 But should print:

 a.v1 = 0
 a.v2 = 0
 a.v1 = 1
 a.v2 = 2
 a.v1 = 0
 a.v2 = 0

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10172>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC