From 93277d5d9d8c9a342f1305b81ce821d8a460558d Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 1 May 2018 16:01:00 +1000 Subject: [PATCH] json/tree: add from_json that takes a path --- json/tree.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/json/tree.hpp b/json/tree.hpp index 614ab043..8ac12abc 100644 --- a/json/tree.hpp +++ b/json/tree.hpp @@ -379,4 +379,16 @@ from_json (const json::tree::node &n, Args&&... args) ); } + +//----------------------------------------------------------------------------- +template +T +from_json (const std::experimental::filesystem::path &src, Args &&...args) +{ + return from_json ( + *json::tree::parse (src), + std::forward (args)... + ); +} + #endif