Skip to content

Build error on OSX with Xcode 16.3 #1825

Closed
@pcaspers

Description

@pcaspers

I am getting a compile error on OSX with Xcode 16.3.

[build] /Library/Developer/CommandLineTools/SDKs/MacOSX15.4.sdk/usr/include/c++/v1/string:821:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
[build]   821 |   static_assert(is_same<_CharT, typename traits_type::char_type>::value,
[build]       |                                          ^
[build] /Users/a/repositories/homebrew/include/cpprest/streams.h:79:39: note: in instantiation of template class 'std::basic_string<unsigned char>' requested here
[build]    79 |     static std::basic_string<uint8_t> format(const T& val)
[build]       |                                       ^
[build] /Library/Developer/CommandLineTools/SDKs/MacOSX15.4.sdk/usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
[build]    23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
[build]       |                             ^

See here

https://developer.apple.com/documentation/xcode-release-notes/xcode-16_3-release-notes

In particular:

The base template for std::char_traits has been removed. If you are using std::char_traits with types other than char, wchar_t, char8_t, char16_t, char32_t or a custom character type for which you specialized std::char_traits, your code will stop working. The Standard does not mandate that a base template is provided, and such a base template is bound to be incorrect for some types, which could previously cause unexpected behavior while going undetected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions