You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// When there's no constructor, an empty brace initializer does
46
+
// value initialization = {0,0,0,0,0}
47
+
TempData td_emptyInit{};
47
48
48
49
// Uninitialized = if used, emits warning C4700 uninitialized local variable
49
50
TempData td_noInit;
@@ -55,7 +56,7 @@ int main()
55
56
}
56
57
```
57
58
58
-
When a `class` or `struct` has no constructor, you provide the list elements in the order that the members are declared in the `class`. If the `class` has a constructor, provide the elements in the order of the parameters. If a type has a default constructor, either implicitly or explicitly declared, you can use default brace initialization (with empty braces). For example, the following `class` may be initialized by using both default and non-default brace initialization:
59
+
When a `class` or `struct` has no constructor, you provide the list elements in the order that the members are declared in the `class`. If the `class` has a constructor, provide the elements in the order of the parameters. If a type has a default constructor, either implicitly or explicitly declared, you can use brace initialization with empty braces to invoke it. For example, the following `class` may be initialized by using both empty and non-empty brace initialization:
59
60
60
61
```cpp
61
62
#include <string>
@@ -106,7 +107,7 @@ int main()
106
107
}
107
108
```
108
109
109
-
If the default constructor is explicitly declared but marked as deleted, default brace initialization can't be used:
110
+
If the default constructor is explicitly declared but marked as deleted, empty brace initialization can't be used:
0 commit comments