mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 04:34:40 +03:00
book: use curly brackets to initailize aggregate objects (#112)
This commit is contained in:
@@ -426,10 +426,10 @@ auto arr = new auto(10); // arr as int *
|
||||
> In addition, `auto` cannot be used to derive array types:
|
||||
>
|
||||
> ```cpp
|
||||
> auto auto_arr2[10] = arr; // illegal, can't infer array type
|
||||
> auto auto_arr2[10] = {arr}; // illegal, can't infer array type
|
||||
>
|
||||
> 2.6.auto.cpp:30:19: error: 'auto_arr2' declared as array of 'auto'
|
||||
> auto auto_arr2[10] = arr;
|
||||
> auto auto_arr2[10] = {arr};
|
||||
> ```
|
||||
|
||||
### decltype
|
||||
|
||||
Reference in New Issue
Block a user