book: use curly brackets to initailize aggregate objects (#112)

This commit is contained in:
TinyWang
2020-08-10 15:57:48 +08:00
committed by Changkun Ou
parent 9dbdd53f2e
commit 4de9eb49f7
3 changed files with 5 additions and 5 deletions

View File

@@ -361,10 +361,10 @@ auto arr = new auto(10); // arr 被推导为 int *
> 此外,`auto` 还不能用于推导数组类型:
>
> ```cpp
> auto auto_arr2[10] = arr; // 错误, 无法推导数组元素类型
> auto auto_arr2[10] = {arr}; // 错误, 无法推导数组元素类型
>
> 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