#ifndef __Cache_ah__
#define __Cache_ah__

#include "ResultCache.h"

aspect Cache {
  advice call("% square(...)") : around () {
    if (!cache.find(*(unsigned*)tjp->arg(0), tjp->result())) {
      tjp->proceed();
      cache.insert(*(unsigned*)tjp->arg(0), *tjp->result());
    }
  }
};

#endif // __Cache_ah__
