Skip to content

Adding value_to support without including a Boost.JSON header #550

@pdimov

Description

@pdimov

Similar to #549, but in the other direction; it should be possible to add value_to support without including a Boost.JSON header. A minimal example is in https://godbolt.org/z/WsG33GrMP. Unlike the value_from case, this compiles, and the only reason it doesn't link is that the signature of value_to does not match the documented one.

I'm not sure why it's necessary for value_to to disappear from overload resolution when T is a reference. value_to is not intended to be an overload set. References can be disallowed by a static_assert in the body.

Not taking value in order to disallow implicit conversions is I suppose legitimate, but it can be achieved by adding a deleted templated overload (https://godbolt.org/z/Tqonvj9bT).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions