DiscoverGoing Deep (Audio) - Channel 9C++ and Beyond 2012: Scott Meyers - Universal References in C++11
C++ and Beyond 2012: Scott Meyers - Universal References in C++11

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

Update: 2012-10-09
Share

Description

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!

Download slides

Comments 
00:00
00:00
x

0.5x

0.8x

1.0x

1.25x

1.5x

2.0x

3.0x

Sleep Timer

Off

End of Episode

5 Minutes

10 Minutes

15 Minutes

30 Minutes

45 Minutes

60 Minutes

120 Minutes

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

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

Charles