You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The convert<T>::decode() and Node::as<T>() signature inconsistency. #506
decode() needs a reference for an already constructed object's reference that it can mutate to decode the Node's contents into it. as() returns a brand new T object, it works by default constructing a T object then calling decode() on it. It is problematic if:
T is not default constructible.
It is impossible or expensive to mutate T.
I suggest to use the same signature as Node::as(). In case of an error a client can just throw an exception, preferebly TypedBadConversion. It could have the added benefit of marking the error's location more precisely if it happens at a nested subnode.
Activity