Monday, 29 May 2017

Cool things in C++17

C++17 reached Draft status in March 2017.  Cool features include:
  • nested namespaces (namespace X::Y {}, instead of namespace X { namespace y {}})
  • initializer in if statement (i.e. instead of if (condition), then if ( init; condition)
  • guaranteed copy elision by compilers in some cases
Notes - copy elision refers to a compiler optimization technique that removes unnecessary copying of objects.

No comments: