NorskFlag pic
EnglishFlag pic
Effective C++11/14 Programming
Kontakt
Intruktør(er):
Ingen instruktør
Pris:
NOK 14900,-
Antall dager:
2
Inkludert:

Course material, Textbook and Lunch

Emner:

MOVING FROM C++98 TO C++11

RVALUE REFERENCES, MOVE SEMANTICS AND PERFECT FORWARDING

SECRETS OF THE C++11 THREADING API

LAMBDA EXPRESSIONS

 

ABOUT THE COURSE 

Software developers familiar with the fundamentals of C++11 are ready to advance from knowing what's in C++11 to understanding how to apply it effectively. This seminar, based on information in Scott Meyers´ forthcoming Effective C++11/14, highlights the insights and best practices of the most accomplished C++11 programmers: the things they almost always do (or almost always avoid doing) to produce clear, correct, efficient code. As a bonus, it includes information on effective use of the extensions to C++11 in the forthcoming C++14. 

FORMAT

The seminar is based on lecture presentations, with ample time for questions and discussion by attendees. There are no hands–on exercises, but participants are welcome – encouraged! – to use their C++ development environments to experiment with the ideas in the seminar as they are presented.

WHAT YOU WILL LEARN

The topics in the seminar are in the form of guidelines, a format proven in Scott's C++ books. The guidelines to be discussed are:

        MOVING FROM C++98 TO C++11

  • Prefer auto to explicit type declarations.
  • Remember that auto + { expr } => std::initializer_list.
  • Prefer nullptr to 0 and NULL.
  • Prefer scoped enums to unscoped enums.
  • Distinguish () and {} when creating objects.
  • Declare functions noexcept whenever possible.
  • Make const member functions thread–safe.

        RVALUE REFERENCES, MOVE SEMANTICS, AND PERFECT FORWARDING

  • Distinguish universal references from rvalue references.
  • Avoid overloading on universal references.
  • Pass and return rvalue references via std::move, universal references via std::forward.
  • Assume that move operations are not present, not cheap, and not used.

        THE CONCURRENCY API

  • Make std::threads unjoinable on all paths.
  • Use std::launch::async with std::async if asynchronicity is essential.
  • Be aware of varying thread handle destructor behavior.
  • Create tasks, not threads.
  • Consider void futures for one-shot event communication.
  • Pass parameterless functions to std::thread, std::async, and std::call_once.
  • Use std::lock to acquire multiple locks.
  • Use native handles to transcend the C++11/14 API.   
        LAMBDA EXPRESSIONS
  • Prefer lambdas to std::bind.
  • Beware default captures in member functions.    
        SMART POINTERS
  • Use std::make_shared and std::make_unique whenever possible.
        MISCELLANEOUS
  • Keep abreast of standardization.

WHO SHOULD ATTEND

Systems designers, programmers, and technical managers involved in the design, implementation, and maintenance of production libraries and applications using C++11. Participants should understand the basic features of C++11 (e.g., rvalue references, lambda expressions, smart pointers, threads and futures, variadic templates), but expertise is not required.  Where necessary, Scott will summarize features that attendees are not familiar with.

 

 

KURSOVERSIKT Effective C++11/14 Programming
For øyeblikket ingen kurs for denne kurstypen