Home > Backend Development > C++ > What C 17 Features are Implemented in C 1z Compilers?

What C 17 Features are Implemented in C 1z Compilers?

Susan Sarandon
Release: 2024-12-26 19:10:12
Original
700 people have browsed it

What C  17 Features are Implemented in C  1z Compilers?

C 17 Features in C 1z Compilers

C 17 is now feature complete, and compilers supporting "C 1z" will implement most of the features added in C 17. Some of the key features that will be available in C 1z compilers include:

Language Features:

  • Template argument deduction for class templates
  • template
  • Non-type template arguments fixes
  • templatetypename bob> struct foo {}
  • ( Folding ... expressions ) with revisions
  • auto x{8}; is an int
  • Modernizing using with ... and lists

Lambda:

  • Constexpr lambdas
  • Capturing *this in lambdas

Attributes:

  • [[fallthrough]], [[nodiscard]], [[maybe_unused]] attributes
  • [[attributes]] on namespaces and enumerators

Syntax Cleanup:

  • Inline variables
  • Cleaner multi-return and flow control with structured bindings and if (init; condition) syntax

Data Types:

  • std::variant
  • std::optional
  • std::any
  • std::string_view

Invoke Stuff:

  • std::invoke
  • std::apply
  • std::make_from_tuple
  • is_invocable, is_invocable_r, and invoke_result

File System TS v1:

  • File I/O-related classes and functions

Algorithms:

  • New algorithms such as for_each_n, reduce, and transform_reduce

Threading:

  • std::shared_mutex

Library Fundamentals TS v1:

  • Searching algorithms and techniques
  • Polymorphic allocator (std::pmr)
  • Container improvements including splicing and non-member std::size

Smart Pointers:

  • unique_ptr fixes

Other Changes:

  • C 17 library is based on C11 instead of C99
  • Special math functions
  • std::clamp
  • std::void_t

Note: Please consult the compiler documentation for the exact list of C 17 features supported by your specific compiler.

The above is the detailed content of What C 17 Features are Implemented in C 1z Compilers?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template