Skip to content

Unable to use gnu mpz types for NumberIntegerType #3578

@eric-wieser

Description

@eric-wieser

Description

I was hoping it would be possible to set NumberIntegerType and NumberUnsignedType (putting aside #2573 for now) to an arbitrary precision integer type ("big integers"), such as on wrapper types around the gnu multiple precision arithmetic library.

Unfortunately, this is not permitted as json_value is a C-style tagged union that doesn't permit any of its types to have non-trivial destructors/move constructors etc; and mpz is stored on the heap.

I understand this is quite a big ask, but I thought it was worth having an issue explicitly mentioning big integers since I wasn't able to find an existing one via search.

Reproduction steps

Attempt to use some numeric heap type for the numeric type parameters. I'm afraid I don't have a trivial example to hand without external dependencies.

Expected vs. actual results

In an ideal world, I would expect everthing to just work. Instead, I get compiler errors about deleted operators on json_value due to it being a union of non trivial types.

Minimal code example

No response

Error messages

No response

Compiler and operating system

N/A

Library version

d4daaa8

Validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions