Category Archives: C++

Notes about the ever increasing C++ language.

Modern C++: What you need to know (talk by Herb Sutter)

Interesting presentation by Herb Sutter on the modern C++. The video won’t play very well on this page, so grab it from here. There are different formats and slides available for download. Strangely enough he spends considerable amount of time … Continue reading

Posted in C++ | Tagged , | Leave a comment

Universal Reference

C++11 brought in new reference type – rvalue reference. This reference is declared using “&&”. There are a whole slew of articles on how to distinguish between rvlaue and lvalue references, but we won’t go into this here. There are … Continue reading

Posted in C++ | Leave a comment

std::move doesn’t do move

std::move doesn’t really move anything. All move does is accept either an lvalue or rvalue argument, and return it as an rvalue without triggering a copy construction[1]: template <class T> typename remove_reference<T>::type&& move(T&& a) { return a; } Some information … Continue reading

Posted in C++ | Leave a comment

Reference Collapsing Rules

The first of the remaining two rules for rvalue references affects old-style lvalue references as well. Recall that in pre-C++11, it was not allowed to take a reference to a reference: something like A& & would cause a compile error. C++11, by … Continue reading

Posted in C++, Computers | Tagged | 1 Comment