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).
Similar to #549, but in the other direction; it should be possible to add
value_tosupport without including a Boost.JSON header. A minimal example is in https://godbolt.org/z/WsG33GrMP. Unlike thevalue_fromcase, this compiles, and the only reason it doesn't link is that the signature ofvalue_todoes not match the documented one.I'm not sure why it's necessary for
value_toto disappear from overload resolution whenTis a reference.value_tois not intended to be an overload set. References can be disallowed by a static_assert in the body.Not taking
valuein 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).