C++ language support

Apple supports C++ with the Apple Clang compiler (included in Xcode) and thelibc++ C++ standard library runtime (included in SDKs and operating systems). The compiler and runtime are regularly updated to offer new functionality, including many leading-edge features specified by the ISO C++ standard.

    Supported features

    The following tables list support for ISO C++ standard features available on Apple platforms and in the Apple Clang compiler, as well as links to related documentation. While most features are supported by all Apple operating systems, some features depend on specific OS capabilities or require support in the libc++.dylib shared library provided with the OS. Code that uses those features should be guarded by the minimal deployment target check as noted.

    C++26 (expected)

    FeaturePaperNotes
    Unevaluated stringsP2361R6Requires Xcode 16.3
    constexpr cast fromvoid*P2738R1Requires Xcode 16.3
    On the ignorability of standard attributesP2552R3Requires Xcode 16.3
    User-generatedstatic_assert messagesP2741R3Requires Xcode 16.3
    Placeholder variables with no nameP2169R4Requires Xcode 16.3
    Template parameter initializationP2308R1Requires Xcode 16.3
    Remove Deprecated Arithmetic Conversion on EnumerationsP2864R2Requires Xcode 16.3
    Clarifying rules for brace elision in aggregate initializationP3106R1Requires Xcode 16.3
    Pack IndexingP2662R3Requires Xcode 16.3
    \= delete("should have a reason");P2573R2Requires Xcode 16.3
    Attributes for Structured BindingsP0609R3Requires Xcode 16.3
    Disallow Binding a Returned Glvalue to a TemporaryP2748R5Requires Xcode 16.3
    Trivial infinite loops are not Undefined BehaviorP2809R3Requires Xcode 16.3
    Deleting a Pointer to an Incomplete Type Should be Ill-formedP3144R2Requires Xcode 16.3
    Ordering of constraints involving fold expressionsP2963R3Requires Xcode 16.3
    Remove undefined behavior from lexingP2621R2 (DR)Requires Xcode 16
    Making non-encodable string literals ill-formedP1854R4 (DR)Requires Xcode 16
    Add @, $, and ` to the basic character setP2558R2Requires Xcode 15 or later
    Unevaluated stringsP2361R6Requires Xcode 16
    Features implemented in the libc++ library
    constexpr placement newP2747R2Requires Xcode 26
    A type trait for detecting virtual base classesP2985R0Requires Xcode 26
    Concatenation ofstrings andstring_viewsP2591R5Requires Xcode 16.3
    MembervisitP2637R3Requires Xcode 16.3
    Printing Blank Lines withprintlnP3142R0Requires Xcode 16.3
    Interfacingstringstreams withstring_viewP2495R3Requires Xcode 16.3
    Addtuple protocol tocomplexP2819R2Requires Xcode 16.3
    Testing for success or failure of<charconv> functionsP2497R0Requires Xcode 16
    ADL-proofstd::projectedP2538R1Requires Xcode 16
    Native handles and file streamsP1759R6Requires Xcode 16
    Interfacingbitset withstring_viewP2697R1Requires Xcode 16
    Saturation arithmeticP0543R3Requires Xcode 16
    Runtime format stringsP2905R2Requires Xcode 16
    Runtime format strings IIP2918R2Requires Xcode 16
    Fix formatting of code units as integers (Dude, where’s mychar?)P2909R4Requires Xcode 16
    std::span over an initializer listP2447R6Requires Xcode 16
    span.at()P2821R5Requires Xcode 16
    Remove Deprecatedstd::allocator Typedef From C++26P2868R3Requires Xcode 16
    Removebasic_string::reserve() From C++26P2870R3Requires Xcode 16
    Remove Deprecated Unicode Conversion Facets from C++26P2871R3Requires Xcode 16

    C++23

    FeaturePaperNotes
    DeducingthisP0847R7Requires Xcode 16.3
    Change scope of lambda trailing-return-typeP2036R3Requires Xcode 16.3
    Relaxing someconstexpr restrictionsP2448R2Requires Xcode 16.3
    A type trait to detect reference binding to temporaryP2255R2Requires Xcode 16.3
    Static and explicit object member functions with the same parameter-type-listsP2797R0Requires Xcode 16.3
    The Equality Operator You Are Looking ForP2468R2Requires Xcode 16
    Labels at the end of compound statementsP2324R2Requires Xcode 16
    staticoperator()P1169R4Requires Xcode 16
    char8_t Compatibility and Portability FixP2513R3Requires Xcode 16
    staticoperator[]P2589R1Requires Xcode 16
    Permittingstatic constexpr variables inconstexpr functionsP2647R1Requires Xcode 16
    consteval needs to propagate upP2564R3(DR)Requires Xcode 16
    Referencing The Unicode StandardP2736R2Requires Xcode 16
    De-deprecatingvolatile compound operations.P2327R1Requires Xcode 15 or later
    Support for#warningP2437R1Requires Xcode 15 or later
    Remove non-encodable wide character literals and multicharacter wide character literalsP2362R3Requires Xcode 15 or later
    Delimited escape sequencesP2290R3Requires Xcode 15 or later
    Named universal character escapesP2071R2Requires Xcode 15 or later
    Support for UTF-8 as a portable source file encodingP2295R6Requires Xcode 15 or later
    Relax requirements onwchar_t to match existing practicesP2460R2Requires Xcode 15 or later
    Multidimensional subscript operatorP2128R6Requires Xcode 14.3 or later
    Non-literal variables (and labels and gotos) inconstexpr functionsP2242R3Requires Xcode 14.3 or later
    auto(x): decay-copy in the languageP0849R8Requires Xcode 14.3 or later
    Literal suffixuz, z forsize_t,ssize_tP0330R8
    Make() in lambdas optional in all casesP1102R2
    if constevalP1938R3
    Allow duplicate attributesP2156R1
    Narrowing contextual conversions toboolP1401R5
    Trimming whitespaces before line splicingP2223R2
    C++ identifier syntax using unicode standard annex 31P1949R7
    Mixedstring literal concatenationP2201R1
    Character sets and encodingsP2314R4
    Consistent character literal encodingP2316R2
    Preprocessing directiveselifdef andelifndefP2334R1
    Extend init-statement to allow alias-declarationP2360R0
    Attributes on lambda expressionsP2173R1
    Make declaration order layout mandatedP1847R4
    Features implemented in the libc++ library
    Relaxing Ranges Just A SmidgeP2609R3Requires Xcode 26
    A trait for implicit lifetime typesP2674R1Requires Xcode 26
    A Standardflat_mapP0429R9Requires Xcode 26
    Pipe support for user-defined range adaptorsP2387R3Requires Xcode 16.3
    out_ptr - a scalable output pointer abstractionP1132R8Requires Xcode 16.3
    std::ranges::contains_subrange (std::ranges::contains has been implemented in a previous release)P2302R4Requires Xcode 16.3
    ranges::find_last(), ranges::find_last_if(), andanges::find_last_if_not()P1223R5Requires Xcode 16.3
    Poison Pills are Too ToxicP2602R2Requires Xcode 16.3
    starts_with andends_withP1659R3Requires Xcode 16
    views::chunk_byP2443R1Requires Xcode 16
    std::ranges::containsP2302R4

    Requires Xcode 16

    Not supported:std::ranges::contains_subrange

    Support exclusive mode forfstreamsP2467R1Requires Xcode 16
    Add a conditionalnoexcept specification tostd::applyP2517R1Requires Xcode 16
    Should the output ofstd::print to a terminal be synchronized with the underlying stream?P2539R4Requires Xcode 16
    Deprecatenumeric_limits::has_denormP2614R2Requires Xcode 16
    Formatting rangesP2286R8Requires Xcode 15.3 or later
    ranges::to : A function to convert any range to a containerP1206R7Requires Xcode 15.3 or later
    move_iterator<T*> should be a random access iteratorP2520R0Requires Xcode 15.3 or later
    constexpr type_info::operator==()P1328R1Requires Xcode 15.3 or later
    Formattingthread::idP2693R1Requires Xcode 15.3 or later
    Monadic operations forstd::expectedP2505R5Requires Xcode 15.3 or later
    Making multi-param constructors of views explicitP2711R1Requires Xcode 15.3 or later
    std::invoke_rP2136R3Requires Xcode 15.3 or later
    Relaxing range adaptors to allow for move only typesP2494R2Requires Xcode 15.3 or later
    Improving default container formattingP2585R1Requires Xcode 15.3 or later
    std::ranges::views::repeatP2474R2Requires Xcode 15.3 or later
    std::mdspanP0009R18Requires Xcode 15.3 or later
    Formatted outputP2093R14Requires Xcode 15.3 or later
    Add the missingempty tomdspanP2613R1Requires Xcode 15.3 or later
    mdspan: rename pointer and contiguousP2604R0Requires Xcode 15.3 or later
    string_view range constructor should beexplicitP2499R0Requires Xcode 15 or later
    A moreconstexpr bitsetP2417R2Requires Xcode 15 or later
    forward_likeP2445R1Requires Xcode 15 or later
    Makingstd::unique_ptr constexprP2273R3Requires Xcode 15 or later
    Add constexpr modifiers to functionsto_chars andfrom_chars for integral types in<charconv> headerP2291R3Requires Xcode 15 or later
    std::string::substr() &&P2438R2Requires Xcode 15 or later
    std::expectedP0323R12Requires Xcode 15 or later
    views::as_rvalueP2446R2Requires Xcode 15 or later
    std::unexpected should haveerror() as member accessorP2549R1Requires Xcode 15 or later
    Conditionally borrowed rangesP2017R1Requires Xcode 15 or later
    Function to mark unreachable codestd::unreachable()P0627R6Requires Xcode 14.3 or later
    Type trait to detect scoped enumerationsstd::is_scoped_enumP1048R1
    contains() function forbasic_string andbasic_string_viewP1679R3
    std::to_underlying for enumerationsP1682R3
    std::visit() for classes derived fromstd::variantP2162R2
    Prevent overconstraining allocators in container deduction guidesP1518R2
    Prohibitbasic_string andbasic_string_view construction fromnullptrP2166R1
    Requirespan &basic_string_view to be trivially copyableP2251R1

    C++20

    FeaturePaperNotes
    Class types as non-type template parametersP0732R2Requires Xcode 16.3
    Immediate functions(consteval)P1073R3Requires Xcode 16.3
    typename optional in more contextsP0634R3Requires Xcode 16
    Structured binding extensionsP1091R3Requires Xcode 16
    P1381R1
    Parenthesized initialization of aggregatesP0960R3Requires Xcode 16
    P1975R0
    ConceptsP0734R0Not supported: papersP2103R0,DR1496,DR1734,P0848R3
    P1084R2
    P1141R2
    P1616R1
    P1452R2
    P1972R0
    P1980R0
    P2493R0
    P2092R0
    Immediate functions (consteval)P1073R3Requires Xcode 15 or later
    P1937R2
    Default member initializers for bit-fieldsP0683R1
    Fixconst-qualified (const&-qualified) pointers to membersP0704R1
    Allow lambda-capture[=, this]P0409R2
    __VA_OPT__ for comma omission and comma deletionP0306R4
    P1042R1
    Designated initializersP0329R4
    Familiar template-parameter-list syntax for generic lambdasP0428R2
    Range-basedfor statements with initializerP0614R1
    ADL and function templates that are not visibleP0846R0
    const mismatch with defaulted copy constructorP0641R2
    Consistent comparison (operator<=>)P0515R3
    P0905R1
    P1120R0
    P1185R2
    P1186R3
    P1630R1
    P1946R0
    P1959R0
    P2085R0
    Relaxing access checking on specializationsP0692R1
    Default constructible and assignable stateless lambdasP0624R2
    Allowing lambdas in unevaluated contextsP0315R4Not supported: [temp.deduct/9]
    [[no_unique_address]] attributeP0840R2
    [[likely]] and[[unlikely]] attributesP0479R5
    Pack expansion in lambda init-captureP0780R2
    Relaxations ofconstexpr restrictionsP1064R0
    P1002R1
    P1327R1
    P1330R0
    P1331R2
    P1668R1
    P0784R7
    Prohibit aggregates with user-declared constructorsP1008R1
    Feature test macrosP0941R2
    explicit(bool): conditionally explicit constructorP0892R2
    Signed integers are two’s complementP1236R1
    char8_t: A type for UTF-8 characters and stringsP0482R6
    std::is_constant_evaluatedP0595R2
    Nested inline namespacesP1094R2
    Stronger unicode requirementsP1041R4
    P1139R2
    CoroutinesP0912R5
    Deprecate comma operator in subscripting expressions likea[b,c]P1161R3
    Deprecate some problematic uses ofvolatileP1152R4
    [[nodiscard("with reason")]]P1301R4
    usingenumP1099R5
    Permit conversions to arrays of unknown boundP0388R4
    constinitP1143R2
    Pseudo-destructors end object lifetimesP0593R6 (DR)
    Implicit move for more local objects and rvalue referencesP1825R0 (DR)
    Features implemented in the libc++library
    Reviewing Deprecated Facilities of C++17 for C++20P0619R4Requires Xcode 26
    The Mothership has Landed: Adding<=> to the LibraryP1614R2Requires Xcode 16.3
    Symmetry for spaceshipP0905R1Requires Xcode 16.3
    std::atomic_refP0019R8Requires Xcode 16.3
    Addwait/notify toatomic_ref<T>P1643R1Requires Xcode 16.3
    Missing constexpr instd::optional andstd::variantP2231R1Requires Xcode 16.3
    Floating Point AtomicP0020R6Requires Xcode 16
    Text formatting(std::format)P0645R10Requires Xcode 15.3 or later
    Efficient access tobasic_stringbuf’s bufferP0408R7Requires Xcode 15.3 or later
    Utility functions to implement uses-allocator constructionP0591R4Requires Xcode 15 or later
    char8_t: A type for UTF-8 characters and stringsP0482R6Requires Xcode 15 or later
    nodiscard in the LibraryP0600R1Requires Xcode 15 or later
    polymorphic_allocator<> as a vocabulary typeP0339R6Requires Xcode 15 or later
    Constexpr forstd::complexP0415R1Requires Xcode 15 or later
    Adoptsource_location for C++20P1208R6Requires Xcode 15 or later
    Input Range AdaptorsP1035R7Requires Xcode 15 or later
    Views should not be required to be default constructibleP2325R3Requires Xcode 15 or later
    Smart pointer creation with default initializationP1020R1Requires Xcode 15 or later
    Superior String SplittingP2210R2Requires Xcode 15 or later
    basic_istream_view::iterator should not be copyableP1638R1Requires Xcode 15 or later
    Outputstd::chrono::days with ‘d’ suffixP1650R0Requires Xcode 15 or later
    Ranges adaptors for non-copyable iteratorsP1862R1Requires Xcode 15 or later
    Rename“_default_init” Functions, Rev1P1973R1Requires Xcode 15 or later
    elements_view needs its own sentinelP1994R1Requires Xcode 15 or later
    Fixistream_viewP2432R1Requires Xcode 15 or later
    Makingstd::vector constexprP1004R2Requires Xcode 14.3 or later
    Consistent stateful allocator propagation foroperator+(basic_string)P1165R1Requires Xcode 14.3 or later
    Support arrays inmake_shared andallocate_sharedP0674R1Requires Xcode 14.3 or later
    Makingstd::string constexprP0980R1Requires Xcode 14.3 or later
    ConsiderATOMIC_FLAG_INIT undeprecationLWG3659Requires Xcode 14.3 or later
    char8_t backward compatibility remediationP1423R3Requires Xcode 14.3 or later
    Bit-casting object representationsP0476R2Requires Xcode 14.3 or later
    RangesP0896R4Requires Xcode 14.3 or later
    P2415R2Requires Xcode 14.3 or later
    P2281R1Requires Xcode 14.3 or later
    std::endianP0463R1
    Addconstexpr modifiers to functions in<algorithm> and<utility> headersP0202R3
    Makestd::memory_order a scoped enumerationP0439R0
    String prefix and suffix checkingP0457R2
    Transformation traitremove_cvrefP0550R2
    De-pessimize legacy<numeric> algorithms withstd::moveP0616R0
    Utility to convert a pointer to a raw pointerP0653R2
    Deprecateis_podP0767R1
    Library support for the spaceship (comparison) operator<=>P0768R1
    Treating unnecessary decayP0777R1
    <span>P0122R7
    Thou shalt not specializestd function templates!P0551R3
    <version>P0754R2
    Comparing unordered containersP0809R0
    Constexpr iterator requirementsP0858R0
    string::reserve should not shrinkP0966R1
    Checking for existence of an element in associative containersP0458R2
    Guaranteed copy elision for piecewise constructionP0475R1
    Integral power-of-2 operationsP0556R3
    Reviewing deprecated facilities of C++17 for C++20P0619R4Not supported: P0619, Sections D.4, D.7, D.11, and D.12
    Improving the return value of erase-like algorithmsP0646R1
    Efficient sized delete for variable sized classesP0722R3
    Implicit conversion traits and utility functionsP0758R1
    fpos requirementsP0759R1
    Add shift to<algorithm>P0769R2
    constexpr for swap and swap related functionsP0879R0
    The identity metafunctionP0887R1
    Standard library conceptsP0898R3
    Eradicating unnecessarily explicit default constructorsP0935R0
    constexpr comparison operators forstd::arrayP1023R0
    std::unwrap_ref_decay andstd::unwrap_referenceP0318R1
    Simplified partial function applicationP0356R5
    Supporting Incomplete types Inreference_wrapperP0357R3
    Fixingoperator>>(basic_istream&, CharT*)P0487R1
    std::is_constant_evaluated()P0595R2
    Variant and optional should propagate copy/move trivialityP0602R4
    Improving variant’s Converting Constructor/AssignmentP0608R3
    visit<R>: explicit return type for visitP0655R1
    std::function move constructor should benoexceptP0771R1
    Heterogeneous lookup for unordered containersP0919R3
    <chrono> zero(), min(), and max() should benoexceptP0972R0
    constexpr instd::pointer_traitsP1006R1
    Miscconstexpr bitsP1032R1
    Remove comparison operators ofstd::spanP1085R2
    Adopt consistent container erasure from library fundamentals 2P1209R0
    RemoveCommonReference requirement fromStrictWeakOrderingP1248R1
    Makingstd::underlying_type SFINAE-friendlyP0340R3
    Well-behaved interpolation for numbers and pointersP0811R3
    Usability enhancements forstd::spanP1024R3
    Makecreate_directory() intuitiveP1164R1
    signed ssize() functions,unsigned size() functionsP1227R2
    Traits for [Un]bounded ArraysP1357R1
    Mandating the standard library: Clause 16 - Language support libraryP1458R1
    Mandating the standard library Clause 18 - Diagnostics libraryP1459R1
    Mandating the standard library: Clause 20 - Strings libraryP1462R1
    Mandating the standard library: Clause 22 - Iterators libraryP1464R1
    to_array from LFTS with updatesP0325R4
    Bit operationsP0553R4
    Math constantsP0631R8
    Moreonstexpr containersP0784R7
    constexpr invokeP1065R2
    Synchronization library (<barrier>,<latch>,<semaphore> and notification functions onstd::atomic)P1135R6Minimum deployment target:
    macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0
    Exposing a narrow contract for ceil2P1355R2
    Relocate endian’s specificationP1612R1
    bind_front should not unwrapreference_wrapperP1651R0
    Remove dedicated precalculated hash lookup interfaceP1661R1
    Fixing atomic initializationP0883R2
    Range constructor forstd::string_viewP1391R4
    Range constructor forstd::spanP1394R4
    constexpr for numeric algorithmsP1645R1
    Heterogeneous lookup for unordered containersP1690R1
    Addmax() to latch and barrierP1865R1Minimum deployment target:
    macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0
    Concept traits should be named after conceptsP1871R1
    span should havesize_type, notindex_typeP1872R0
    Removestd::weak_equality andstd::strong_equalityP1959R0
    Safe integral comparisonsP0586R2
    Improving the return value of erase-like algorithms II: free erase/erase ifP1115R3
    On the names of low-level bit manipulation functionsP1956R1
    Wording forboolean-testableP1964R2
    Fixed-sizespan construction from dynamic rangeP1976R2
    Remove tuple-like protocol support from fixed-extent spanP2116R0
    Missing constexpr instd::optional andstd::variantP2231R1Not supported: changes to std::variant

    C++17

    FeaturePaperNotes
    static_assert with no messageN3928
    Removing trigraphsN4086
    typename in a template template parameterN4051
    Newauto rules for direct-list-initializationN3922
    Fold expressionsN4295
    P0036R0
    u8 character literalsP0036R0
    Nested namespace definitionN4230
    Attributes for namespaces and enumeratorsN4266
    Allow constant evaluation for all non-type template argumentsN4268
    Remove deprecatedregister storage classP0001R1
    Remove deprecatedbool incrementP0002R1
    Make exception specifications part of the type systemP0012R1
    __has_include in preprocessor conditionalsP0061R1
    [[fallthrough]] attributeP0188R1
    [[nodiscard]] attributeP0189R1
    P1771R1 (DR)
    [[maybe_unused]] attributeP0212R1
    Aggregate initialization of classes with base classesP0017R1
    constexpr lambda expressionsP0170R1
    Differingbegin andend types in range-basedforP0184R0
    Lambda capture of*thisP0018R3
    Direct-list-initialization ofenumsP0138R2
    Hexadecimal floating-point literalsP0245R1
    Using attribute namespaces without repetitionP0028R4
    Dynamic memory allocation for over-aligned dataP0035R4
    Template argument deduction for class templatesP0091R3
    P0512R0
    P0620R0 (DR)
    P0702R1 (DR)
    Non-type template parameters withauto typeP0127R2
    Guaranteed copy elisionP0135R1
    Stricter expression evaluation orderP0145R3
    P0400R0
    Requirement to ignore unknown attributesP0283R2
    constexpr if statementsP0292R2
    Inline variablesP0386R2
    Structured bindingsP0217R3
    P0961R1 (DR)
    P0969R0 (DR)
    Separate variable and condition forif andswitchP0305R1
    Matching of template template-parameters to argumentsP0522R0This feature can be source breaking. Should be enabled explicitly with the compiler flag -frelaxed-template-template-args
    Removing deprecated dynamic exception specificationsP0003R5
    Features implemented in the libc++library
    <memory_resource>P0220R1

    Requires Xcode 15

    Minimum deployment target: iOS 17.0, macOS 14.0, watchOS 10.0 and tvOS 17.0.

    Filesystem libraryP0219R1Minimum deployment target:
    macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0
    P0218R1
    P0392R0
    P0317R1
    P0492R2
    TransformationTrait Aliasvoid_t.N3911
    Invoke function templateN4169
    std::uncaught_exceptionsN4259
    TriviallyCopyablereference_wrapper.N4277
    Improved insertion interface for unique-key maps.N4279
    std::size(),std::empty() andstd::data()N4280
    Contiguous IteratorsN4284
    Cleanup for exception-specification and throw-expression.N4285
    Improvingstd::pair andstd::tupleN4387
    bool_constantN4389
    shared_mutexN4508

    Pass-fno-exceptions compiler flag to back deploy to older OSes. Note that methods that throw exceptions on failure will abort in this mode.

    LWG 2228 missing SFINAE ruleN4366
    Minimal incomplete type support for standard containersN4510
    Remove deprecated iostreams aliases.P0004R1
    Adopt type traits variable templates for C++17P0006R0
    Polishing<chrono>P0092R1
    Constant view:std::as_const helper function template.P0007R1
    Makingstd::owner_less more flexibleP0074R0
    Logical type traits rev 2P0013R1
    Re-enabling shared_from_thisP0033R1
    Adoptnot_fn from library fundamentals 2 for C++17P0005R4
    constexpratomic::is_always_lock_freeP0152R1
    [nothrow-]swappable traitsP0185R1
    Fixing a design mistake in the searchers interfaceP0253R1
    An algorithm toclamp a value between a pair of boundary valuesP0025R0
    3-argument overload tostd::hypotP0030R1
    Constexpr modifiers forreverse_iterator,move_iterator, array and Range AccessP0031R0
    Givestd::string a non-const.data() member functionP0272R1
    is_callable, the missing INVOKE related traitP0077R2
    Homogeneous interface forvariant,any andoptionalP0032R3
    Extending memory management toolsP0040R3
    C++17 should refer to C11 instead of C99P0063R3
    Splicing maps and setsP0083R3
    Emplace return typeP0084R2
    Variant: a type-safe union for C++17P0088R3

    Minimum deployment target:
    bad_variant_access and methods that throw it:get andvisit require macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0

    Pass-fno-exceptions compiler flag to back deploy to older OSes. Note that methods that throw exceptions on failure will abort in this mode.

    Replacement of class objects containing reference membersP0137R1
    shared_ptr::weak_typeP0163R0
    Synopses for the c libraryP0175R1
    Reserve a new library namespace for future standardizationP0180R2
    make_from_tuple: apply for constructionP0209R2
    Integratingstd::string_view andstd::stringP0254R2
    has_unique_object_representationsP0258R2
    Adopt selected library fundamentals V2 components for C++17P0295R0
    Adopt library fundamentals V1 TS components for C++17 (optional,string_view,any)P0220R1

    Minimum deployment target:
    bad_optional_access andbad_any_cast, and methods that throw them:optional::value andany_cast require macOS 10.13, iOS 12.0, tvOS 12.0, watchOS 5.0

    Pass-fno-exceptions compiler flag to back deploy to older OSes. Note that methods that throw exceptions on failure will abort in this mode.

    Removing allocator support instd::functionP0302R1
    Making optional greater equal againP0307R2
    Better names for parallel execution policies in C++17P0336R1
    Deleteoperator= for polymorphic_allocatorP0337R0
    A<random> nomenclature tweakP0346R1
    Fixes fornot_fnP0358R1
    Temporarily discouragememory_order_consumeP0371R1
    Making variant greater equalP0393R3
    Removing deprecated exception specifications from C++17P0003R5
    Elementary string conversionsstd::to_chars,std::from_charsP0067R5

    Minimum deployment target:
    For integral types, macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0

    For floating-point types, macOS 13.3, iOS 16.3, tvOS 16.3, watchOS 9.3

    Literal suffixes forbasic_string_viewP0403R1
    Mergingshared_ptr changes from Library Fundamentals to C++17P0414R2
    Constexpr forstd::char_traitsP0426R1
    Resolving LWG Issues recommon_typeP0435R1
    Correcting library usage of “literal type”P0503R0
    Revisiting in-place tag types for any/optional/variantP0504R0
    Wording for GB 50 -constexpr forchronoP0505R0
    Updating “Restrictions on exception handling”P0509R1
    Disallowing references, incomplete types, arrays, and empty variantsP0510R0
    Poisoning the hashP0513R0
    Clarify thatshared_future’s copy operations have wide contractsP0516R0
    Makefuture_error constructibleP0517R0
    shared_ptr use_count/uniqueP0521R0
    Variadic lock guard(rev 5)P0156R2
    A byte type definitionP0298R3
    File system library on non-POSIX-like operating systemsP0430R2
    Integrating template deduction for class templates into the standard libraryP0433R2
    common_type and durationP0548R1
    Resolvingatomic<T> named base class inconsistenciesP0558R1
    noexcept for hash functionsP0599R1
    Resolving GB 55, US 84, US 85, US 86P0604R0
    Some improvements to class template argument deduction integration into the standard libraryP0739R0

    C++14

    FeaturePaperNotes
    Tweak to certain c++ contextual conversionsN3323
    Binary literalsN3472
    decltype(auto)N3638
    Return type deduction for normal functions
    Initialized lambda capturesN3648
    Generic lambdasN3649
    Variable templatesN3651
    Relaxing requirements on constexpr functionsN3652
    Member initializers and aggregatesN3653
    Clarifying memory allocationN3664
    [[deprecated]] attributeN3760
    Single quotation mark as digit separatorN3781
    Sized deallocation (delete anddelete[])N3778
    Features implemented in the libc++library
    Terminology for container element requirements - Rev 1N3346
    Making operator functors greater<>N3421
    std::result_of and SFINAEN3462
    integral_constant improvementsN3545
    Null forward iteratorsN3644
    std::exchange()N3668
    Compile-time integer sequencesN3658
    Addressing tuples by typeN3670
    Making non-modifying sequence operations more robustN3671
    make_uniqueN3656
    Quoted StringsN3654
    User-defined LiteralsN3642
    TransformationTraits Redux (excluding part 4)N3655
    Heterogeneous comparison lookupN3657
    Fixingconstexpr member functions withoutconstN3669
    Shared lockingN3659
    User-defined literals forstd::complexN3779
    Discouragingrand()N3924
    Consistent metafunction aliasesN3887
    Renameshared_mutex toshared_timed_mutexN3891
    Constexpr library additions: chrono, containers, utilities, complex numbers, functionalN3469
    N3470
    N3471
    N3302
    N3789

    C++11

    FeaturePaperNotes
    Rvalue referencesN2118
    P1825R0 (DR)
    Rvalue references for*thisN2439
    Initialization of class objects by rvaluesN1610
    Non-static data member initializersN2756
    Variadic templatesN2242
    Extending variadic template template parametersN2555
    Initializer listsN2672
    P1009R2 (DR)
    P1957R2 (DR)
    Static assertionsN1720
    auto-typed variablesN1984
    Multi-declaratorautoN1737
    Removal ofauto as a storage-class specifierN2546
    New function declarator syntaxN2541
    Declared type of an expressionN2343
    Incomplete return typesN3276
    Right angle bracketsN1757
    Default template arguments for function templatesDR226
    Solving the SFINAE problem for expressionsDR339
    Alias templatesN2258
    Extern templatesN1987
    Null pointer constantN2431
    Strongly-typed enumsN2347
    Forward declarations for enumsN2764
    DR1206
    Standardized attribute syntaxN2761
    ConstExpr: generalized constant expressionsN2235
    P0859R0 (DR)
    Alignment supportN2341
    Conditionally-support behaviorN1627
    Changing undefined behavior into diagnosable errorsN1727
    Delegating constructorsN1986
    Inheriting constructorsN2540
    P0136R1 (DR)
    Explicit conversion operatorsN2437
    New character typesN2249
    Unicode string literalsN2442
    Raw string literalsN2442
    Universal character names in literalsN2170
    User-defined literalsN2765
    Standard Layout TypesN2342
    Defaulted functionsN2346
    P1286R2 (DR)
    Deleted functionsN2346
    Extended friend declarationsN1791
    ExtendingsizeofN2253
    DR850
    Inline namespacesN2535
    Unrestricted unionsN2544
    Local and unnamed types as template argumentsN2657
    Range-based forN2930
    P0962R1 (DR)
    Explicit virtual overridesN2928
    N3206
    N3272
    Allowing move constructors to throw[noexcept]N3050
    Defining move special member functionsN3053
    Concurrency
    Sequence pointsN2239
    Atomic operationsN2427
    Strong compare and exchangeN2748
    Bidirectional fencesN2752
    Memory modelN2429
    Data-dependency ordering: atomics and memory modelN2664
    Propagating exceptionsN2179
    Allow atomics use in signal handlersN2547
    Thread-local storageN2659
    Dynamic initialization and destruction with concurrencyN2660
    C99 Features in C++11
    __func__ predefined identifierN2340
    C99 preprocessorN1653
    long longN1811

    C++98/03

    Clang and libc++ supports all features of the ISO C++ 1998 standard and the defects addressed in the ISO C++ 2003 standard.

    C++ standard library hardening

    Starting in Xcode 16, the C++ standard library supportshardening. Turning on hardening enables checks for common cases of misuse of the standard library; if a check fails, the program is reliably terminated, helping prevent security vulnerabilities and diagnose some cases of undefined behavior.

    Hardening can be turned on via Xcode Build Settings(Apple Clang - Language - C++ >Enable C++ Standard Library Hardening):

    • No” — don’t enable any hardening checks.
    • Yes (fast)” — enable low-overhead security-critical checks at runtime. We recommend most applications to adopt this setting in the production environment.
    • Yes (extensive)” — enable all available low-overhead checks at runtime, including general logic errors in addition to security vulnerabilities. This setting has a higher overhead compared to “Yes” but is still intended to be usable in production by applications that would benefit from the increased level of correctness checking.
    • Yes (debug)” — enable all available checks, including heuristic checks that might have significant performance overhead, as well as internal library assertions. We recommend most applications to use this setting in non-production environments (such as test suites and CI, as well as for local development). This setting should not be used in production due to the overhead.

    Note that the Debug configuration enablesdebug hardening mode by default. When enabling hardening, make sure not to accidentally override the stricterdebug mode with a less-strict production-capable mode in the Debug configuration. Turning on hardening might expose latent bugs and cause the application to terminate at runtime. We recommend testing your code thoroughly in a development environment.

    For more information about hardening, refer to thelibc++ documentation.

    Related resources

    Videos

    Release notes and documentation