Skip to content

Build fails with libc++ 19 and later: std::basic_string<uint8_t> in streams.h #11

Closed

Description

@garethsb

Release/include/cpprest/streams.h uses std::basic_string<uint8_t> in Value2StringFormatter<uint8_t>. The standard only defines std::char_traits for the character types, and libc++ 19 removed the generic std::char_traits template that made other types work. So the header no longer compiles with libc++ 19 or later. Current libstdc++ still accepts it.

The use is in a public header, so it breaks every consumer that includes cpprest/streams.h with libc++. That includes the default toolchain on macOS (Apple Clang), and Clang with -stdlib=libc++ elsewhere.

Proposed Fix

Base the fix on microsoft/cpprestsdk#1829, which defines cpprestsdk's own character traits for uint8_t and adjusts the tests. Do not use #1820, which specializes std::char_traits<uint8_t> in namespace std. The standard does not allow that for a type that the program does not define.

Add a CI job that builds with Clang and libc++ (or on macOS), so that this stays fixed.

References

Part of #15.

Activity

  1. added a commit that references this issue on Nov 4, 2026
    37fe924
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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