Skip to content

Instantly share code, notes, and snippets.

@vpiotr
Last active January 29, 2017 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpiotr/83b36377aaf50ec4f7b0 to your computer and use it in GitHub Desktop.
Save vpiotr/83b36377aaf50ec4f7b0 to your computer and use it in GitHub Desktop.
Demonstrates how to use xnode as cache.
#include "xnode_property_list.h"
#include "xnode.h"
xnode_named_list cache;
// already existing entries will automatically destroyed and replaced
cache.put("MAMA", xnode.value_of("mama"));
cache.put("PAPA", xnode().hold(new Person("PAPA")));
cache.put("TRUMP", xnode().hold(new USPresident("TRUMP")));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment