Skip to content
0:00 / 0:00

#movesemantics#perfectforwarding#templates

CppCon 2017: Nicolai Josuttis “The Nightmare of Move Semantics for Trivial Classes”

CppCon

189K subscribers • 135 videos on Hallway • Conference channel

YouTube
  • Recommended by 2 people: 1 in engineering communities and 1 curated list.
  • Presented by Nicolai Josuttis, author and C++ standards committee member
  • Linked in the descriptionCppCon/CppCon2017
  • An opinion. It argues one side of a question engineers disagree on.

Advanced. Deep dive for people who know the field.

99K views9 years ago2 recommendations

Programming languagesC++Design patterns

Nicolai Josuttis demonstrates how implementing move semantics and constructors for simple C++ classes can lead to overly complex template code.

CppCon.org — Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2017 — Assume, we implement a very simple class having just multiple string members. Even ordinary application programmer prefer to make it simple and fast. You think you know how to do it? Well beware! It can become a lot harder than you initially might assume. So, let’s look at a trivial class with multiple string members and use live coding to see the effect using different implementation approaches (using constructors passing by value, by reference, by perfect forwarding, or doing more sophisticated tricks). Sooner than later we will fall into the deep darkness of universal/forwarding references, enable_if, type traits, and concepts. — Nicolai Josuttis: IT Communication Nicolai Josuttis (josuttis.com) is an independent system architect, technical manager, author, and consultant. He designs mid-sized and large software systems for the telecommunications, traffic, finance, and manufacturing industries. He is well known in the programming community because he not only speaks and writes with authority (being the (co-)author of the world-wide best sellers The C++ Standard Library (www.cppstdlib.com), C++ Templates, and SOA in Practice), but is also an innovative presenter, having talked at various conferences and events. — Videos Filmed & Edited by Bash Films: BashFilms.com Work at Hudson River Trading (HRT): tinyurl.com/safxfctf --- Videos Filmed & Edited by Bash Films: BashFilms.com

Why it's here

2 people recommend this

What people say. Recommended as an explanation of the complexities and pitfalls of C++ move semantics and constructor overloading.

u/Batman_AoDin r/programming • Recommends

On “The Rule of Seven: how to overload the brain of a programmer for no good reason”

That said, getting the constructors right is needlessly complicated: link to this video

programming-talkscurated list on GitHubRecommends

Under “C++”

The Nightmare of Move Semantics for Trivial Classes 00:57:15 by **Nicolai Josuttis** (2017)