Closed meierfra-ergon closed 1 year ago
Thanks! It should be other.err_handler()
. Could you update your pull request with that change?
done.
But I am not sure this is correct either. first I thought we should move the other.errhandler, but then I realized the super_type(std::move(other))
in the initializer_list. Is it even safe to use other
after that (for losslessnumber and err_handler)?
Either way, would the default move constructor not be a better choice here?
basic_json_decode_options(basic_json_decode_options&& other) = default
It's safe. std::move(other)
doesn't move anything, it just casts its argument to an rvalue
. The base class doesn't touch other.err_handler_
.
The reason why we didn't use
basic_json_decode_options(basic_json_decode_options&& other) = default
is because, with multiple inheritance, some supported compilers were unable to generate a default move constructor.
Since this is a move constructor, I should have suggested
std::move(other.err_handler_)
as the argument to err_handler_()
, though.
thanks for explaining, I updated the PR to use move() to initialize errhandler
Thanks for contributing!
I stumbled on this, while trying out jsoncons.
I got the compile error:
other constructors use 'default_json_parsing' directly, so I think this is what you want.