Skip to content

libc++ on Apple platforms may not provide floating-point std::from_chars #571

@zhjwpku

Description

@zhjwpku

It seems that on macOS, when using Clang with libc++, linking fails with call to deleted function 'from_chars' for floating-point types. I created a Compiler Explorer example to demonstrate the issue:

https://godbolt.org/z/3oar38qG9

The error indicates that std::from_chars is only enabled for integral types in this libc++ version, and the floating-point overload is not available. (clang 20 supported from_chars)

Given this, I'm wondering whether we should fall back to std::strtof / std::strtod / std::strtold when parsing floating-point numbers. What do you think?

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