diff --git a/json/tree.hpp b/json/tree.hpp index 8ac12abc..d8d723a9 100644 --- a/json/tree.hpp +++ b/json/tree.hpp @@ -350,10 +350,13 @@ namespace json::tree { // Instantiate this template for the type you wish to output. We use a // helper class here to avoid partial template specialisation of a // function (eg, for templated types). - template + template struct io { - static std::unique_ptr serialise (const T&); - static T deserialise (const json::tree::node&); + static std::unique_ptr + serialise (const T&, Args &&...args); + + static T + deserialise (const json::tree::node&, Args &&...args); }; } @@ -363,7 +366,7 @@ template std::unique_ptr to_json (const T &t, Args&&... args) { - return json::tree::io::serialise ( + return json::tree::io::serialise ( t, std::forward(args)... ); } @@ -374,7 +377,7 @@ template T from_json (const json::tree::node &n, Args&&... args) { - return json::tree::io::deserialise ( + return json::tree::io::deserialise ( n, std::forward(args)... ); } @@ -385,7 +388,7 @@ template T from_json (const std::experimental::filesystem::path &src, Args &&...args) { - return from_json ( + return from_json ( *json::tree::parse (src), std::forward (args)... );