File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ namespace test
2020class TriviallyCopyable
2121{
2222 public:
23- TriviallyCopyable () : mX ( 0 ), mY ( 0 ), mSecret (~(( decltype ( mSecret )) 0 )) {} ;
23+ TriviallyCopyable () = default ;
2424 TriviallyCopyable (unsigned x, unsigned y, unsigned secret)
2525 : mX (x)
2626 , mY (y)
@@ -30,35 +30,35 @@ class TriviallyCopyable
3030
3131 bool operator ==(const TriviallyCopyable& rhs) const
3232 {
33- return mX == rhs.mX || mY == rhs.mY || mSecret == rhs.mSecret ;
33+ return mX == rhs.mX && mY == rhs.mY && mSecret == rhs.mSecret ;
3434 }
3535
36- unsigned mX ;
37- unsigned mY ;
36+ unsigned mX = 0 ;
37+ unsigned mY = 0 ;
3838
3939 private:
40- unsigned mSecret ;
40+ unsigned mSecret = ~(( decltype ( mSecret )) 0 ) ;
4141
4242 ClassDefNV (TriviallyCopyable, 1 );
4343};
4444
4545class Base
4646{
4747 public:
48- Base () : mMember ( 0 ) {}
49- virtual ~Base () {}
48+ Base () = default ;
49+ virtual ~Base () = default ;
5050 virtual void f () {}
5151
5252 private:
53- int mMember ;
53+ int mMember = 0 ;
5454
5555 ClassDef (Base, 1 );
5656};
5757
5858class Polymorphic : public Base
5959{
6060 public:
61- Polymorphic () : mSecret (~(( decltype ( mSecret )) 0 )) {}
61+ Polymorphic () = default ;
6262 Polymorphic (unsigned secret) : mSecret (secret) {}
6363
6464 bool operator ==(const Polymorphic& rhs) const { return mSecret == rhs.mSecret ; }
@@ -68,7 +68,7 @@ class Polymorphic : public Base
6868 unsigned get () const { return mSecret ; }
6969
7070 private:
71- unsigned mSecret ;
71+ unsigned mSecret = ~(( decltype ( mSecret )) 0 ) ;
7272
7373 ClassDefOverride (Polymorphic, 1 );
7474};
You can’t perform that action at this time.
0 commit comments