SHARE
TWEET

Untitled

a guest Jan 28th, 2020 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. abstract class ICacheable
  2. {
  3.    virtual void cache() = 0;
  4. }
  5.  
  6. template <bool Caching = false>
  7. class Cacheable : public ICacheable
  8. {
  9.    inline void cache() {}
  10. }
  11.  
  12. template <>
  13. class Cacheable<true> : public ICacheable
  14. {
  15.    inline void cache() { /* ... */ }
  16. }
  17.  
  18. class Scheduler
  19. {
  20.    inline static ICacheable new(bool isCacheable)
  21.    {
  22.       return (isCacheable)? new Cacheable<true> : Cacheable<false>;
  23.    }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top