json/tree: add from_json that takes a path

This commit is contained in:
Danny Robson 2018-05-01 16:01:00 +10:00
parent 63cf40eeca
commit 93277d5d9d

View File

@ -379,4 +379,16 @@ from_json (const json::tree::node &n, Args&&... args)
); );
} }
//-----------------------------------------------------------------------------
template <typename T, class ...Args>
T
from_json (const std::experimental::filesystem::path &src, Args &&...args)
{
return from_json<T> (
*json::tree::parse (src),
std::forward<Args> (args)...
);
}
#endif #endif