I know, ValueIterator
from JsonCPP cannot be used in standard STL algorithms directly. But
is there a some "indirect" way to use it in STL algorithms (maybe via Boost.Iterator or something like this)? I want something likes to following:
Json::Value root = getJson(); //came from outside
std::vector<Json::Value> vec;
std::copy
( make_some_smart_iterator(...) // some iterator produced with start of root
, make_some_smart_iterator(...) // some iterator produced with end of root
, std::back_inserter(vec)
);
There is a custom iterator derived from
boost::iterator_facade
.And client code is following: