Блог пользователя CodingKnight

Автор CodingKnight, 7 лет назад, По-английски

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

  • Проголосовать: нравится
  • -20
  • Проголосовать: не нравится

»
7 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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.

  • »
    »
    7 лет назад, # ^ |
    Rev. 7   Проголосовать: нравится 0 Проголосовать: не нравится

    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,