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