mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 20:54:41 +03:00
Fix syntax error in Rc-in-class-initializer
This commit is contained in:
@@ -3741,7 +3741,7 @@ Setting a `Vector1` to empty after detecting an error is trivial.
|
|||||||
int j;
|
int j;
|
||||||
public:
|
public:
|
||||||
X() :i{666}, s{"qqq"} { } // j is uninitialized
|
X() :i{666}, s{"qqq"} { } // j is uninitialized
|
||||||
X(int i) :i{ii} {} // s is "" and j is uninitialized
|
X(int ii) :i{ii} {} // s is "" and j is uninitialized
|
||||||
// ...
|
// ...
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3755,7 +3755,7 @@ How would a maintainer know whether `j` was deliberately uninitialized (probably
|
|||||||
int j {0};
|
int j {0};
|
||||||
public:
|
public:
|
||||||
X2() = default; // all members are initialized to their defaults
|
X2() = default; // all members are initialized to their defaults
|
||||||
X2(int i) :i{ii} {} // s and j initialized to their defaults
|
X2(int ii) :i{ii} {} // s and j initialized to their defaults
|
||||||
// ...
|
// ...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user