requires Drawable
| 21 | /*<<Static polymorphism - concepts>>*/ |
| 22 | template <Drawable TDrawable = class Drawable> // requires Drawable<TDrawable> |
| 23 | class App { |
| 24 | public: |
| 25 | explicit App(const TDrawable drawable) : drawable{drawable} {} |
| 26 | void draw(std::ostream& out) const { drawable.draw(out); } |
| 27 | |
| 28 | private: |
| 29 | const TDrawable drawable; |
| 30 | }; |
| 31 | |
| 32 | struct Square { |
| 33 | void draw(std::ostream& out) const { out << "Square"; } |
nothing calls this directly
no outgoing calls
no test coverage detected