Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class IStrategy
- {
- public:
- virtual void use() = 0;
- };
- class FooStrategy : public IStrategy
- {
- public:
- FooStrategy(A a, B b) { c = /* some operations with a, b */ }
- virtual void use() { std::cout << c; }
- private:
- C c;
- };
- class BarStrategy : public IStrategy
- {
- public:
- BarStrategy(D d, E e) { f = /* some operations with d, e */ }
- virtual void use() { std::cout << f; }
- private:
- F f;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement