Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // JSON-Like structure
- typedef std::vector<std::any> Array;
- typedef std::unordered_map<std::string, std::any> Object;
- std::any tableau = Array({ 25, "élément" });
- std::any objet = Object({
- {
- "omfg", tableau,
- },
- {
- "bar", 6,
- },
- {
- "baz", Object({
- {"foo", 2}
- })
- }
- });
- std::cout << (tableau.type() == typeid(Array)) << std::endl;
- std::cout << (objet.type() == typeid(Object)) << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement