Archive

Posts Tagged ‘C++11’

Illustrating C++17 though code examples

March 29th, 2017 Comments off

Descriptions of C++17 features, presented mostly in “Tony Tables”.

There are actually over 100 changes in C++17, only some of them are listed here.

Caveat1: C++17 is completed, but not signed off yet. There may still be changes, although highly unlikely (modulo defects).

Caveat2: I make mistakes. This is more likely.

GitHub

The rules for auto-generated constructors and operators

May 28th, 2014 No comments
  • The default constructor is auto-generated if there is no user-declared constructor (§12.1/5).
  • The copy constructor is auto-generated if there is no user-declared move constructor or move assignment operator (because there are no move constructors or move assignment operators in C++03, this simplifies to “always” in C++03) (§12.8/8).
  • The copy assignment operator is auto-generated if there is no user-declared move constructor or move assignment operator (§12.8/19).
  • The destructor is auto-generated if there is no user-declared destructor (§12.4/4).

C++0x only:

  • The move constructor is auto-generated if there is no user-declared copy constructor, copy assignment operator or destructor, and if the generated move constructor is valid (e.g. if it wouldn’t need to assign constant members) (§12.8/10).
  • The move assignment operator is auto-generated if there is no user-declared copy constructor, copy assignment operator or destructor, and if the generated move assignment operator is valid (e.g. if it wouldn’t need to assign constant members) (§12.8/21).

from StackOverflow

Tags: ,

10 new C++11 features in Visual Studio 2013

February 3rd, 2014 No comments

The Visual Studio 2013 C++ compiler has a number of new C++11 features. I’d like to give you a quick overview of these features using examples from the upcoming VS2013 edition of my book, C++11 Rocks.

Alex Korban

“Rule of five”

March 15th, 2013 No comments

Rule is “No copy function, move function, or destructor be compiler-generated if any of these functions is user-provided.”

New paper: N3578, Proposing the Rule of Five—Walter Brown