User Tools

Site Tools


This is an old revision of the document!


C++ links/resources.


  • Constant expressions (const and constexpr) (10.4)
    • A class with a constexpr constructor is called a literal type.
  • Implicit type conversion (10.5)
  • nothrow forms of new and delete (11.2.4)
  • initializer lists

Tutorials Point C++


  • encapsulation
  • data hiding
  • inheritance
  • polymorphism (Shape -- Circle, Rectangle)

New features in C++11

move semantics

variadic templates

rvalue references

forwarding references

initializer lists

static assertions


lambda expressions


template aliases


strongly-typed enums



delegating constructors

user-defined literals

explicit virtual overrides

final specifier

default functions

deleted functions

range-based for loops

special member functions for move semantics

converting constructors

explicit conversion functions

inline namespaces

non-static data member initializers

right angle brackets

ref-qualified member functions

trailing return types

Figure out

  • namespaces
  • throw/exceptions
    • try/catch


  • using {} for initialization instead of =
    • catches narrowing conversions like “int a {3.14};”
  • “auto” type deduction from initializer, “auto b = true”
  • “constexpr” as long as expression really is a constant (eventually)
    • “constexpr int i = square(?)”
    • any functions invoked must also be declared as “constexpr”
  • declared size of array must be constant expression
  • range-for-statement (for any sequence of elements)
    • int v[] = {1,2,3,4,5};
    • for (auto x : v)
    • for (auto x : {1,2,3,4,5})
    • for (auto& x : v) { ++x; }
  • references in declarations
  • kinds of classes
    • concrete
    • abstract

Standard library

  • std::list
  • std::string

Coding style

  • use “const” as much as possible, to qualify class methods
  • functions defined in a class are inlined by default
  • define non-member routines if they don't need access to the class


Parsers/static code checkers/beautifiers

C++ Style Guides

c.1565684817.txt.gz · Last modified: 2019/08/13 08:26 by rpjday