2025-04-30から1日間の記事一覧
c++のメンバへのポインタの使い方をまとめます 利用例 たとえば以下のデータ構造について struct Employee { int id; std::string name; double salary; }; std::vector<Employee> employees; std::sort()で Employee::id をキーにソートしたい場合を考えますこの場合</employee>…
c++のメンバへのポインタの使い方をまとめます 利用例 たとえば以下のデータ構造について struct Employee { int id; std::string name; double salary; }; std::vector<Employee> employees; std::sort()で Employee::id をキーにソートしたい場合を考えますこの場合</employee>…