GoingDeep: C++ and Beyond 2012: Scott Meyers - Universal References in C++11

GoingDeep

Scott Meyers presents "Universal References in C++11". This was filmed at C++ and Beyond 2012. This is the full session in all of its splendor. Huge thanks to Scott for allowing C9 to provide this excellent C++11 content to the world.From Scott's recently published article in the October 2012.

Running time
3h38m
File size
76.00MB

Download Original File | View original post

Episode synopsis

Scott Meyers presents "Universal References in C++11". This was filmed at C++ and Beyond 2012. This is the full session in all of its splendor. Huge thanks to Scott for allowing C9 to provide this excellent C++11 content to the world.

From Scott's recently published article in the October 2012 edition of ACCU's Overload:

Given that rvalue references are declared using "&&", it seems reasonable to assume that the presence of "&&" in a type declaration indicates an rvalue reference. That is not the case:

Widget&& var1 = someWidget; // here, "&&" means rvalue reference

auto&& var2 = var1; // here, "&&" does not mean rvalue reference

template<typename T>

void f(std::vector<T>&& param); // here, "&&" means rvalue reference

template<typename T>

void f(T&& param); // here, "&&" does not mean rvalue reference

In this article, I describe the two meanings of "&&" in type declarations, explain how to tell them apart, and introduce new terminology that makes it possible to unambiguously communicate which meaning of "&&" is intended. Distinguishing the different meanings is important, because if you think "rvalue reference" whenever you see "&&" in a type declaration, you'll misread a lot of C++11 code.

Tune in. Scott's an incredible presenter and it's well worth your time to both read his article and watch his presentation on the subject. Great stuff!

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.” - Jon Ribbens