Viraax

Untitled

Mar 5th, 2021
549
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // JSON-Like structure
  2.  
  3. typedef std::vector<std::any> Array;
  4. typedef std::unordered_map<std::string, std::any> Object;
  5.  
  6. std::any tableau = Array({ 25, "élément" });
  7. std::any objet = Object({
  8.     {
  9.         "omfg", tableau,
  10.     },
  11.     {
  12.         "bar", 6,
  13.     },
  14.     {
  15.         "baz", Object({
  16.             {"foo", 2}
  17.         })
  18.     }
  19. });
  20.  
  21. std::cout << (tableau.type() == typeid(Array)) << std::endl;
  22. std::cout << (objet.type() == typeid(Object)) << std::endl;
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×