Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class ICacheable
- {
- virtual void cache() = 0;
- }
- template <bool Caching = false>
- class Cacheable : public ICacheable
- {
- inline void cache() {}
- }
- template <>
- class Cacheable<true> : public ICacheable
- {
- inline void cache() { /* ... */ }
- }
- class Scheduler
- {
- inline static ICacheable new(bool isCacheable)
- {
- return (isCacheable)? new Cacheable<true> : Cacheable<false>;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement