Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
bowling233 committed Oct 30, 2023
1 parent 3e06b61 commit 45d38ae
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/books/CppPrimer.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ const int *p2 = &ci; // we can change p2; const is low-level

If `p` is a pointer to `int`, then `decltype(*p)` is **`int&`**, not int.

!!! danger "enclosing the name of a variable in parentheses affects the type
returned by `decltype`"
!!! danger "enclosing the name of a variable in parentheses affects the type returned by `decltype`"

- `decltype((variable))` (note, double parentheses) is always a reference type
- `decltype(variable)` is a reference type only if variable is a reference.
Expand Down Expand Up @@ -290,8 +289,7 @@ cout << punct_cnt
#### `vector`-container and class template
<!-- prettier-ignore-start -->
!!! tip "`vector` is a template, not a type. Types generated from vector must
include the element type."
!!! tip "`vector` is a template, not a type. Types generated from vector must include the element type."
<!-- prettier-ignore-end -->
Ways to Initialize a `vector`:
Expand Down

0 comments on commit 45d38ae

Please sign in to comment.