CodingKnight's blog

By CodingKnight, 4 years ago, In English

The ISO International Standard ISO/IEC 14882:2017(E) – Programming Language C++, known as C++17, is the result of excellent efforts by the ISO C++ Standard Foundation Committee to introduce new simple and elegant powerful features to C++.

Adrian D. Finlay, Software Engineer, summarized on Nov 17, 2017, the new C++17 language features that are helpful to competitive programming lovers as well as to professional software engineers and software developers as follows.

"The never-ending journey into learning C++ features….

New Language Features

  1. Addition of __has_include macro

  2. UTF 8 Character Literals

  3. Hexadecimal Floating Point Literals

  4. New rules for deduction of single member list using auto
  5. Update to __cplusplus value

  6. inline variables

  7. New Syntax for Nested Namespace definitions

  8. Initializers added to if/switch statements

  9. constexpr if

  10. New standard attributes fallthrough, maybe_unused &nodiscard ^

  11. Attributes for Enumerator & Namespaces

  12. Error message for static_assert now optional

  13. Structured binding declarations

  14. Keyword typename now allowed in lieu of class in a template’s template paramater

  15. Constant evaluation for non-type template arguments

  16. Class template argument deduction

  17. Extensions on over-aligned Memory Allocation

  18. Fold expressions

  19. List-style Initialization of Enumerations

  20. Specifying non-type template parameters with auto

  21. constexpr lambda expressions

  22. Lambda this by value (*this)

  23. Extending Aggregate Initialization to Base Types

  24. Unknown Attributes Required to be Ignored

  25. Pack Expansions legal in using declarations

  26. Generalization of Range-based for loop

  27. The byte data type ^^

  28. Using attribute namespaces without repetition

  29. Stricter Order of Evaluation Rules

  30. Exception Specifications are part of type definitions

  31. Template-Template Parameters match compatible arguments

  32. Guaranteed Copy Elision

  33. Changes to Specification on Inheriting Constructors

^These are three features grouped into one, which consequently when expanded would make the new feature list count 35.

^^This is implemented in std::byte () and is not a part of the actual language such as the other primitive data types. It is considered a basic type as much as std::string is considered a basic type.

C++17 also introduced a revision to Elementary string conversions".

The Complete Blog posted on Medium.com

 
 
 
 
  • Vote: I like it
  • -20
  • Vote: I do not like it

»
4 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Structured bindings are super nice for competitive programming! You can now unpack stuff easily, as in the for-loop below:

vector<pair<int, int>> v;
    
v.emplace_back(0, 1);
v.emplace_back(2, 7);
    
for (auto& [x, y] : v)
    cout << x - y << endl;

without awkward usage of std::tie.

  • »
    »
    4 years ago, # ^ |
    Rev. 7   Vote: I like it 0 Vote: I do not like it

    Yes, the ISO C++ Standard Foundation Committee did a gratefully appreciated excellent job in developing the ISO International Standard ISO/IEC 14882:2017(E) – Programming Language C++, known as C++17, and introduced many simple and elegant features to C++, that are helpful to competitive programming lovers as well as to professional software engineers and software developers.

    Best wishes,