Skip to main content

Checkpoint: Polymorphism

Challenge on lesson: Checkpoint: Polymorphism

CHALLENGE
Difficulty: intermediate+25 XP

Build a tiny notification system: class Notifier with a pure virtual void send(const std::string& message) const, a public virtual destructor, and a pure virtual const char* channel() const. Implement EmailNotifier (channel "email", send captures its message) and SmsNotifier (channel "sms"). The test dispatches through std::vector<std::unique_ptr<Notifier>>.

Back to lesson: Checkpoint: Polymorphism