Skip to content

Is there a specific reason to not constexprify Dragonbox? #2506

@jk-jeon

Description

@jk-jeon

Is there a specific reason to not constexprify Dragonbox? If not, I believe it should be not terribly difficult to do so, because as far as I know the only real obstacle is that some intrinsics are not constexpr. But we can just wrap those intrinsics with if (!is_constant_evaluated()) and provide fallback implementations along with that. I'm experimenting myself with the recent master branch, and I guess Dragonbox is fine while it fails at this line, I do not know why.

Another issue is that the compiler is whining about static constexpr tables inside constexpr functions being static. (See e.g., https://stackoverflow.com/questions/62458079/static-constexpr-variables-in-a-constexpr-function.) Honestly I think this is a sort of nonsensical language restriction, but well, it is like that. A simple solution is to move those tables out of the functions.

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