Allow create validator from rvalue json
This commit is contained in:
parent
01e3dea71b
commit
d84e0a28d6
@ -1129,16 +1129,22 @@ namespace json_schema
|
||||
|
||||
json_validator::json_validator(schema_loader loader,
|
||||
format_checker format)
|
||||
: root_(std::unique_ptr<root_schema>(new root_schema(loader, format)))
|
||||
: root_(std::unique_ptr<root_schema>(new root_schema(std::move(loader), std::move(format))))
|
||||
{
|
||||
}
|
||||
|
||||
json_validator::json_validator(const json &schema, schema_loader loader, format_checker format)
|
||||
: json_validator(loader, format)
|
||||
: json_validator(std::move(loader), std::move(format))
|
||||
{
|
||||
set_root_schema(schema);
|
||||
}
|
||||
|
||||
json_validator::json_validator(json &&schema, schema_loader loader, format_checker format)
|
||||
: json_validator(std::move(loader), std::move(format))
|
||||
{
|
||||
set_root_schema(std::move(schema));
|
||||
}
|
||||
|
||||
// move constructor, destructor and move assignment operator can be defaulted here
|
||||
// where root_schema is a complete type
|
||||
json_validator::json_validator(json_validator &&) = default;
|
||||
|
||||
@ -171,6 +171,7 @@ public:
|
||||
json_validator(schema_loader = nullptr, format_checker = nullptr);
|
||||
json_validator(json_validator &&);
|
||||
json_validator(const json &, schema_loader = nullptr, format_checker = nullptr);
|
||||
json_validator(json &&, schema_loader = nullptr, format_checker = nullptr);
|
||||
~json_validator();
|
||||
json_validator &operator=(json_validator &&);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user