diff --git a/lectures/inheritance.md b/lectures/inheritance.md index 710574a..65f087a 100644 --- a/lectures/inheritance.md +++ b/lectures/inheritance.md @@ -917,6 +917,9 @@ $PLACEHOLDER #include #include +// Can be any custom type +using Color = int; + struct Noncopyable { Noncopyable() = default; Noncopyable(const Noncopyable&) = delete; @@ -938,8 +941,8 @@ struct JpegIo final : public IoInterface { std::cout << "Reading JPEG from path: " << path << std::endl; return {}; } - virtual void Write(const std::filesystem::path& path, - const std::vector& data) const override { + void Write(const std::filesystem::path& path, + const std::vector& data) const override { std::cout << "Writing JPEG to path: " << path << std::endl; } }; @@ -949,8 +952,8 @@ struct PngIo final : public IoInterface { std::cout << "Reading PNG from path: " << path << std::endl; return {}; } - virtual void Write(const std::filesystem::path& path, - const std::vector& data) const override { + void Write(const std::filesystem::path& path, + const std::vector& data) const override { std::cout << "Writing PNG to path: " << path << std::endl; } };