Added casting constructors to *_wrapper

Added casting constrictors to the *_wrapper structs, so you don't need to use them in user code. This makes the API for the no-boost version compatible with the master branch, so that the example code actually works.
This commit is contained in:
ksdhans 2020-05-21 17:08:33 +08:00 committed by GitHub
parent 9b27c7db88
commit d0b0d797b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,18 +107,26 @@ using array = std::vector<node>;
struct array_wrapper {
array values;
array_wrapper(const array &values) : values(values) {}
};
struct map_wrapper {
map values;
map_wrapper(const map &values) : values(values) {}
};
struct object_wrapper {
std::shared_ptr<object> values;
object_wrapper(const std::shared_ptr<object> &values) : values(values) {}
};
struct lambda_wrapper {
lambda values;
lambda_wrapper(const lambda &values) : values(values) {}
};
std::string render(const std::string& tmplt,