Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      C++17

      From cppreference.com
      <cpp
       
       
       

      C++17 is a major version that follows the minor version C++14 and introduces new language and library features. The standard was published in December 2017.

      The following features were merged into C++17:

      This section is incomplete

      Contents

      [edit]Obsolete features

      [edit]Removed features
      [edit]Deprecated features

      [edit]New language features

      [edit]New headers

      [edit]New library features

      [edit]Utility types

      [edit]Memory management

      [edit]Compile-time programming

      [edit]Algorithms

      [edit]Iterators and containers

      [edit]Numerics

      [edit]Others

      [edit]Defect reports

      Defect Reports fixed in C++17 (290 core, 363 library)

      [edit]Compiler support

      [edit]C++17 core language features

      C++17 feature

       
      Paper(s)

       
      GCC
      Clang
      MSVC
      Apple Clang
      EDG eccp
      Intel C++
      Nvidia HPC C++ (ex PGI)*
      Nvidia nvcc
      Cray
       
      Embarcadero C++ Builder
      IBM Open XL C++ for AIX
      DR11: Newauto rules for direct-list-initializationN392253.819.0 (2015)*Yes4.10.117.017.711.011.0 10.317.1.0
      typename in a template template parameterN405153.519.0 (2015)*Yes4.10.117.017.7Yes*11.0 10.317.1.0
      RemovingtrigraphsN408653.516.0*Yes5.019.111.011.0 10.317.1.0
      Nested namespace definitionN423063.619.0 (Update 3)*Yes4.1217.017.711.011.0 10.317.1.0
      static_assert with no message  (FTM)*N392862.519.10*Yes4.1218.017.711.011.0 10.317.1.0
      Attributes for namespaces and enumerators  (FTM)*  (FTM)*N42664.9 (partial)*
      6
      3.619.0 (2015)*Yes4.1117.017.711.011.0 10.317.1.0
      u8 character literalsN426763.619.0 (2015)*Yes4.1117.017.711.011.0 10.317.1.0
      Allow constant evaluation for all constant template arguments  (FTM)*N426863.619.12*Yes5.019.0.119.111.011.0 10.317.1.0
      Unary fold expressions and empty parameter packsP0036R063.919.12*Yes4.1419.019.111.011.0 10.317.1.0
      Remove deprecated use of theregister keywordP0001R173.819.11*Yes4.1318.017.711.011.0 10.317.1.0
      Remove deprecatedoperator++(bool)P0002R173.819.11*Yes4.1318.017.711.011.0 10.317.1.0
      Make exception specifications part of the type system  (FTM)*P0012R17419.12*Yes4.1419.019.111.011.0 10.317.1.0
      __has_include in preprocessor conditionalsP0061R15Yes19.11*Yes4.1318.017.711.011.0 10.317.1.0
      DR11: New specification forinheriting constructors (DR1941 et al)  (FTM)*P0136R173.919.14**Yes6.119.111.011.0 10.317.1.0
      Aggregate classes with base classes  (FTM)*P0017R173.919.14*Yes5.019.0.119.111.011.0 10.317.1.0
      Fold Expressions  (FTM)*N429563.619.12*Yes4.1419.018.111.011.0 10.317.1.0
      Lambda capture of*this  (FTM)*P0018R373.919.11*Yes4.1419.018.111.011.0 10.317.1.0
      Direct-list-initialization of enumerationsP0138R273.919.11*Yes4.1418.019.111.011.0 10.317.1.0
      constexpr lambda expressions  (FTM)*P0170R17519.11*Yes4.1419.018.111.011.0 10.317.1.0
      Differing begin and end types inrange-based for  (FTM)*P0184R063.919.10*Yes4.1218.017.711.011.0 10.317.1.0
      [[fallthrough]]attributeP0188R173.919.10*Yes4.1318.017.711.011.0 10.317.1.0
      [[nodiscard]]attributeP0189R173.919.11*Yes4.1318.017.711.011.0 10.317.1.0
      [[maybe_unused]]attributeP0212R173.919.11*Yes4.1318.017.711.011.0 10.317.1.0
      Hexadecimalfloating-point literals  (FTM)*P0245R13.0Yes19.11*Yes4.1318.017.711.011.0 10.317.1.0
      Using attribute namespaces without repetitionP0028R473.919.11*Yes4.1318.017.711.011.0 10.317.1.0
      Dynamic memory allocation for over-aligned data  (FTM)*P0035R47419.12*10.0.0*4.1419.019.111.011.0 10.317.1.0
      Constant template parameters withauto type  (FTM)*P0127R27419.14*Yes5.019.0.119.111.011.0 10.317.1.0
      Guaranteedcopy elision  (FTM)*P0135R17419.13*Yes5.019.0.119.111.011.0 10.317.1.0
      Replacement of class objects containing reference membersP0137R17619.14*Yes5.019.111.011.0 10.317.1.0
      Stricterexpression evaluation orderP0145R37419.14*Yes5.019.0.119.111.011.0 10.317.1.0
      Structured Bindings  (FTM)*P0217R37419.11*Yes4.1419.018.111.0*11.0 10.317.1.0
      Ignore unknownattributesP0283R2Yes3.919.0 (2015)*Yes4.1318.017.711.011.0 10.317.1.0
      constexpr if statements  (FTM)*P0292R273.919.11*Yes4.1419.018.111.011.0 10.317.1.0
      Init-statements forif andswitchP0305R173.919.11*Yes4.1418.018.111.011.0 10.317.1.0
      Inline variables  (FTM)*P0386R273.919.12*Yes4.1419.018.111.011.0 10.317.1.0
      Removingdynamic exception specificationsP0003R57419.12*Yes4.1419.019.111.011.0 10.317.1.0
      Pack expansions in using-declarations  (FTM)*P0195R27419.14*Yes5.019.019.111.011.0 10.317.1.0
      DR98: Matching of template template-arguments excludes compatible templates  (FTM)*P0522R07419.12*Yes5.019.0.119.111.011.0 10.317.1.0
      Class template argument deduction  (FTM)*P0091R37519.14*Yes5.019.0.119.111.011.0 10.317.1.0
       

      C++17 feature
       

      Paper(s)
      GCC
      Clang
      MSVC
      Apple Clang
      EDG eccp
      Intel C++
      Nvidia HPC C++ (ex PGI)*
      Nvidia nvcc
      Cray
       
      Embarcadero C++ Builder
      IBM Open XL C++ for AIX

      [edit]C++17 library features

      C++17 feature

       
      Paper(s)

       
      GCC libstdc++
      Clang libc++
      MSVC STL
      Apple Clang*
       
      IBM Open XL C/C++ for AIX*
      Intel Parallel STL
      Embarcadero C++ Builder*
      std::void_t  (FTM)*N39116.13.619.0 (2015)*Yes 17.1.0N/A10.3
      std::uncaught_exceptions()  (FTM)*N42596.13.719.0 (2015)*Yes 17.1.0N/A10.3
      std::size(),std::empty() andstd::data()  (FTM)*N428063.619.0 (2015)*Yes 17.1.0N/A10.3
      std::allocator_traits::is_always_equal,noexcept cleanups  (FTM)*N42586.13.719.0 (2015)*  17.1.0N/A
      std::invoke  (FTM)*N41696.13.719.0 (2015)*Yes 17.1.0N/A
      std::map::try_emplace,std::map::insert_or_assign  (FTM)*N42796.13.719.0 (2015)*Yes 17.1.0N/A
      std::unordered_map::try_emplace,std::unordered_map::insert_or_assign  (FTM)*N42796.13.719.0 (2015)*Yes 17.1.0N/A
      Improvingstd::pair andstd::tupleN43876.1419.0 (Update 2)*Yes 17.1.0N/A10.3
      std::bool_constant  (FTM)*N43896.13.719.0 (2015)*Yes 17.1.0N/A10.3
      std::shared_mutex (untimed)  (FTM)*N450863.719.0 (Update 2)*Yes 17.1.0N/A10.3
      Minimal incomplete type support forstd::forward_list,std::list, andstd::vector  (FTM)*N45103.03.618.0*Yes 17.1.0N/A
      Type traits variable templates  (FTM)*P0006R07.13.819.0 (Update 2)*Yes 17.1.0N/A10.3
      Logical operator type traits  (FTM)*P0013R16.13.819.0 (Update 2)*Yes 17.1.0N/A10.3
      std::as_const  (FTM)*P0007R17.13.819.0 (Update 2)*Yes 17.1.0N/A
      Rounding functions forstd::chrono::duration andstd::chrono::time_point  (FTM)*P0092R17.13.819.0 (Update 2)*Yes 17.1.0N/A
      Transparentstd::owner_less (std::owner_less<void>)  (FTM)*P0074R07.13.819.0 (Update 2)*Yes 17.1.0N/A
      std::not_fn  (FTM)*P0005R4
      P0358R1
      7.13.919.12*Yes 17.1.0N/A10.3
      Parallel algorithms andexecution policies  (FTM)*  (FTM)*P0024R29*17
      (partial)*
      19.14*  18.0*
      std::clamp()  (FTM)*P0025R173.919.0 (Update 3)*10.0.0* 17.1.0N/A10.3
      (nothrow-)swappable traits  (FTM)*P0185R17.1*3.919.0 (Update 3)*10.0.0* 17.1.0N/A10.3
      Polymorphic memory resources  (FTM)*P0220R19.11619.13*15.0.0* 17.1.1N/A10.3
      std::apply  (FTM)*P0220R17.11619.13*Yes 17.1.0N/A
      Searchers  (FTM)*P0220R17.11619.13*Yes 17.1.0N/A
      std::sample  (FTM)*P0220R17.11619.13*Yes 17.1.0N/A
      Mathematical special functions  (FTM)*P0226R1719.14*  17.1.1N/A10.3
      constexprstd::addressof  (FTM)*LWG22967.1Yes19.0 (Update 3)*  17.1.0N/A
      constexpr forstd::reverse_iterator,std::move_iterator,std::array and range access  (FTM)*P0031R07.1419.11*Yes 17.1.0N/A
      constexprstd::atomic<T>::is_always_lock_free  (FTM)*P0152R17.13.919.11*Yes 17.1.0N/A
      std::enable_shared_from_this::weak_from_this  (FTM)*P0033R17.13.919.12*Yes 17.1.0N/A
      3-argument overload ofstd::hypot  (FTM)*P0030R17.13.919.14*Yes 17.1.0N/A
      std::byte  (FTM)*P0298R37519.11*Yes 17.1.1N/A10.3
      std::string_view  (FTM)*N3921
      P0220R1
      P0254R2
      P0403R1
      7.1419.10*(partial)*
      19.11**
      10.0.0* 17.1.0N/A10.3
      std::any  (FTM)*P0220R1
      P0032R3
      7.1419.10*10.0.0* 17.1.0N/A10.3
      std::optional  (FTM)*P0220R17.1419.10*10.0.0* 17.1.0N/A10.3
      Major portion of C11 standard libraryP0063R39.1719.0 (2015)*
      (partial)*
      10.0.0* 17.1.1N/A
      SplicingMaps andSets  (FTM)*P0083R37819.12*10.0.0* 17.1.1N/A
      return type ofemplace* functions of somecontainers changed fromvoid to referenceP0084R27.14.019.11*Yes 17.1.0N/A
      std::variant  (FTM)*P0088R37.1419.10*10.0.0* 17.1.0N/A10.3
      std::make_from_tuple()  (FTM)*P0209R27.13.919.10*Yes 17.1.0N/A10.3
      std::has_unique_object_representations  (FTM)*P0258R27.1619.11*Yes 17.1.1N/A10.3
      std::gcd() andstd::lcm()  (FTM)*P0295R07419.11*Yes 17.1.0N/A10.3
      CWG issue 1776: Replacement of class objects containing reference members (std::launder)  (FTM)*P0137R17.1619.14*Yes 17.1.0N/A
      Extending memory management tools  (FTM)*P0040R37.1419.11*  17.1.0N/A
      shared_ptr::weak_type  (FTM)*P0163R07.13.919.10*Yes 17.1.0N/A
      Elementary string conversions:std::to_chars /std::from_chars  (FTM)*P0067R58*
      11
      7*
      14*
      20*
      19.14**
      19.24*
      10.0.0** 17.1.1*N/A10.3*
      std::shared_ptr andstd::weak_ptr with array supportP0414R271119.12*12.0.0* 17.1.1N/A10.3
      Constexpr for all the member functions ofstd::chrono::duration andstd::chrono::time_point  (FTM)*P0505R07.1419.11*Yes 17.1.1N/A
      std::shared_ptr<T[]>  (FTM)*P0497R07.11119.12*  17.1.1N/A
      constexprstd::char_traits  (FTM)*P0426R18.1419.14*Yes 17.1.1N/A
      File system library (std::filesystem)  (FTM)*P0218R1
      P0219R1
      8719.14*11.0.0* 17.1.1N/A10.3
      Hardware interference size  (FTM)*P0154R112.115 (partial)*
      19
      19.11*  N/A10.3
      std::scoped_lock  (FTM)*P0156R27519.11*Yes 17.1.1N/A10.3
      std::is_aggregate  (FTM)*LWG29117519.15*Yes 17.1.1N/A10.3
      std::is_invocable,std::invoke_result  (FTM)*P0604R07.1Yes19.11*Yes 17.1.1N/A
      DR17:std::hash<std::filesystem::path>LWG365711.41719.32*  N/A
       

      C++17 feature
       

      Paper(s)
      GCC libstdc++
      Clang libc++
      MSVC STL
      Apple Clang*
       
      IBM Open XL C/C++ for AIX*
      Intel Parallel STL
      Embarcadero C++ Builder*
      [edit]Notes
      • As of 2020-11-20, the latest release of Oracle Developer Studiois 12.6. Itsdocumentation does not mention C++17.
      • Cray compiler may have support for some features earlier than 11.0. That version is when it became a derivative of Clang, gaining all of the attendant language feature support of the base compiler. SeeCray/HPE document S-2179.

      * - hover over a cell marked with the star* to see additional pop-up notes.
      DRnn - the numbernn after "DR" denotes target C++ revision the Defect Report is applied to, e.g., DR20 → C++20.

      [edit]External links

      1. C++17 - Wikipedia
      2. Working C++17 examples
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/17&oldid=182718"

      [8]ページ先頭

      ©2009-2025 Movatter.jp