Add const rvalue reference edge-case for ref-qualified member functions section.

This commit is contained in:
Anthony Calandra
2019-06-14 01:15:00 -04:00
parent 1a5af17e8a
commit 95a3b3f7be
2 changed files with 5 additions and 0 deletions

View File

@@ -1188,6 +1188,7 @@ struct Foo {
Bar getBar() & { return bar; }
Bar getBar() const& { return bar; }
Bar getBar() && { return std::move(bar); }
Bar getBar() const&& { return std::move(bar); }
private:
Bar bar{};
};
@@ -1200,6 +1201,8 @@ Bar bar2 = foo2.getBar(); // calls `Bar Foo::getBar() const&`
Foo{}.getBar(); // calls `Bar Foo::getBar() &&`
std::move(foo).getBar(); // calls `Bar Foo::getBar() &&`
std::move(foo2).getBar(); // calls `Bar Foo::getBar() const&&`
```
## C++11 Library Features