From d0b0d797b7a902b5324ed9e3b17e48a1679913e8 Mon Sep 17 00:00:00 2001 From: ksdhans Date: Thu, 21 May 2020 17:08:33 +0800 Subject: [PATCH] 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. --- include/mstch/mstch.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/mstch/mstch.hpp b/include/mstch/mstch.hpp index 5abf5f8..4363976 100644 --- a/include/mstch/mstch.hpp +++ b/include/mstch/mstch.hpp @@ -107,18 +107,26 @@ using array = std::vector; 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 values; + + object_wrapper(const std::shared_ptr &values) : values(values) {} }; struct lambda_wrapper { lambda values; + + lambda_wrapper(const lambda &values) : values(values) {} }; std::string render(const std::string& tmplt,