From 95a3b3f7be1cc333d450b91b4f2a62c0b0053e1e Mon Sep 17 00:00:00 2001 From: Anthony Calandra Date: Fri, 14 Jun 2019 01:15:00 -0400 Subject: [PATCH] Add const rvalue reference edge-case for ref-qualified member functions section. --- CPP11.md | 2 ++ README.md | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CPP11.md b/CPP11.md index caed545..b6080ad 100644 --- a/CPP11.md +++ b/CPP11.md @@ -608,6 +608,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 diff --git a/README.md b/README.md index 750e71f..f4781eb 100644 --- a/README.md +++ b/README.md @@ -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