”工欲善其事,必先利其器。“—孔子《论语.录灵公》
首页 > 编程 > C ++ 17中引入的关键语言和库功能是什么?

C ++ 17中引入的关键语言和库功能是什么?

发布于2025-02-06
浏览:158

What are the Key Language and Library Features Introduced in C  17?
C 17

的新功能在C 17的功能开发之后,已经引入了几个新的语言功能和库添加: [2 class templatesRepresentation of values of any type with template

Lambda Enhancements:

  • 简介Constexpr lambdas 的介绍可以在lambdas 引入新属性,例如[[fallthrough]],[[nodiscard]]和[[and_unused]] [2 ]

      Generalized range-based for loops
    • if constexpr for conditional compilation
  • 其他值得注意的功能: hexadecimal float point literals

      Fixed order-of-evaluation for expressions
    • Direct list-initialization of enums
    • Forward progress guarantees for threads
  • [库添加:数据类型:

      std ::用于表示任何类型的值的任何,包括非副本类型
    • std :: byte表示没有类型信息的数据表示
    • ]std::apply for tuple-based callable invocation
  • std::make_from_tuple for constructing objects from tuples
  • Introduction of is_invocable and related traits

      File System Library:
    • Implementation of the File System Technical Specification (TS)
  • New Algorithms:
  • hendering Enhermements:
    • Atomic guarantees and hardware interference size detection
    • Library Fundamentals TS Additions:
    Searching algorithms (alg.search)
  • polymorphic Arlocator(pmr)
  • Splicing for maps, sets, and unordered containersNon-const data() access for strings

    • Smart Pointers:
    • Fixes and tweaks to unique_ptr
    • Introduction of weak_from_this for managing shared pointers
    • Misc:

用于标准库保留std [0-9]未来标准库的名称空间 std :: clamp,std :: gcd和std :: lcm

的异常处理改进,包括std :: undught_exceptions

std :: as_const,std :: bool_constant,以及各种模板实用程序改进的std :: chrono library 在std

  • 中删除某些C库,,result_of和其他
最新教程 更多>

免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。

Copyright© 2022 湘ICP备2022001581号-3