dropbox / json11

A tiny JSON library for C++11.
MIT License
2.55k stars 613 forks source link

Support for construction from std::unordered_map #74

Closed ancwrd1 closed 8 years ago

ancwrd1 commented 8 years ago

Would be nice to have a Json constructor accept the std::unordered_map parameter as an object as well.

artwyman commented 8 years ago

It does, via the constructor here: https://github.com/dropbox/json11/blob/master/json11.hpp#L108

You can see some code which exercises it here: https://github.com/dropbox/json11/blob/master/test.cpp#L164

Are you seeing it not work in a specific scenario?

ancwrd1 commented 8 years ago

You are right, it works. Was doing it in a wrong way (via Json::object which just appears to be a typedef). Issue can be closed.