C++ オブジェクト指向プログラミング:カプセル化・深いコピー・動的メモリ管理の実践
課題1:コンポジションによるGUIコンポーネントの設計
ボタンとウィンドウの関係をコンポジション(has-a関係)で表現します。WindowクラスがWidgetクラスを含む形で実装します。
Widget.hpp
#pragma once
#include <iostream>
#include <string>
class Widget {
public:
explicit Widget(const std::string &name);
const std::string& na ...
8月8日 14:29 投稿