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
It seems in the current implementation it is not possible to convert YAML-nodes directly into non default-constructable data-types.
The actual breaking point seems to be in 'impl.h:130', where an bare mantle object of the desired type is instantiated on the stack T t;, where T is the template-arg for the to-be-read custom-class. I guess the next instructions are invocing the customized struct bool YAML::convert<T>::decode(Node&, T&), which are to fill the fields of the object with sensible data, by modifying the reference as the second argument.
Wouldn't it be more sensible to define the decoding function as T YAML::convert<T>::decode(Node&) throw() ; thus instead of using the bool as function-return as indicator for successful conversion, rather wrap the decode in an try-except block and so have the possibility to allocate the object on the stack inside the function-body itself?
The text was updated successfully, but these errors were encountered:
It seems in the current implementation it is not possible to convert YAML-nodes directly into non default-constructable data-types.
The actual breaking point seems to be in 'impl.h:130', where an bare mantle object of the desired type is instantiated on the stack
T t;
, where T is the template-arg for the to-be-read custom-class. I guess the next instructions are invocing the customizedstruct bool YAML::convert<T>::decode(Node&, T&)
, which are to fill the fields of the object with sensible data, by modifying the reference as the second argument.Wouldn't it be more sensible to define the decoding function as
T YAML::convert<T>::decode(Node&) throw()
; thus instead of using the bool as function-return as indicator for successful conversion, rather wrap the decode in an try-except block and so have the possibility to allocate the object on the stack inside the function-body itself?The text was updated successfully, but these errors were encountered: