mirror of
https://github.com/AnthonyCalandra/modern-cpp-features.git
synced 2025-12-17 10:04:35 +03:00
Fix incorrect example and inconsistent forwarding references section.
This commit is contained in:
5
CPP11.md
5
CPP11.md
@@ -108,8 +108,9 @@ f(x); // deduces as f(int&)
|
||||
int& y = x;
|
||||
f(y); // deduces as f(int& &&) => f(int&)
|
||||
|
||||
int&& z = 0;
|
||||
f(z); // deduces as f(int&& &&) => f(int&&)
|
||||
int&& z = 0; // NOTE: `z` is an lvalue with type `int&&`.
|
||||
f(z); // deduces as f(int&& &) => f(int&&)
|
||||
f(std::move(z)); // deduces as f(int&& &&) => f(int&&)
|
||||
```
|
||||
|
||||
See also: [`std::move`](#stdmove), [`std::forward`](#stdforward), [`rvalue references`](#rvalue-references).
|
||||
|
||||
Reference in New Issue
Block a user