{"id":18839251,"url":"https://github.com/solareenlo/42cpp-module-05","last_synced_at":"2026-01-28T19:30:17.472Z","repository":{"id":93865666,"uuid":"372407911","full_name":"solareenlo/42cpp-module-05","owner":"solareenlo","description":"C++ practice 05 (Exception, Base class, Derived class, Method pointer)","archived":false,"fork":false,"pushed_at":"2021-06-06T03:41:58.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-30T09:16:10.159Z","etag":null,"topics":["42","42born2code","42cursus","42projects","cpp"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solareenlo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-31T06:41:49.000Z","updated_at":"2021-06-06T03:44:30.000Z","dependencies_parsed_at":"2023-04-29T18:26:02.020Z","dependency_job_id":null,"html_url":"https://github.com/solareenlo/42cpp-module-05","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solareenlo%2F42cpp-module-05","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solareenlo%2F42cpp-module-05/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solareenlo%2F42cpp-module-05/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solareenlo%2F42cpp-module-05/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solareenlo","download_url":"https://codeload.github.com/solareenlo/42cpp-module-05/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239774333,"owners_count":19694700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42","42born2code","42cursus","42projects","cpp"],"created_at":"2024-11-08T02:42:29.860Z","updated_at":"2026-01-28T19:30:17.430Z","avatar_url":"https://github.com/solareenlo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 42cpp-module-05\n\n### ex03\n- 同じ base class からできた複数個の derived class に1つのメソッドから使用できるようにする\n  - メソッドポインタを使用する\n  - new 演算子を使用する\n\n### ex02\n- 同じ base class からの複数個の derived class\n- オーバーライドしたメソッドを両方使用する\n  - derived class のオーバーライドしたメソッドの中でも base class のオーバーライドしたメソッドを呼べる\n\n### ex01\n- 複数個の exception\n  - 上手にエラーハンドリング\n- nested classes\n  - [その13 内部クラスは外側クラスのメンバにアクセスし放題！](http://marupeke296.com/CPP_No13_SubClass.html)\n  - [そろそろ内部クラスに関して一言言っておくか](http://isoparametric.hatenablog.com/entry/20080117/1200575103)\n      ```c++\n      #include \u003ciostream\u003e\n\n      class Hoge {\n       public:\n          Hoge() : bar_(*this) {}\n\n       private:\n          class Bar {\n           public:\n              explicit Bar(Hoge\u0026 hoge) : hoge_(hoge) {}\n              void func() {\n                  hoge_.func();\n              }\n              Hoge\u0026 hoge_;\n          };\n          Bar bar_;\n          void func() {\n              std::cout \u003c\u003c \"func\" \u003c\u003c std::endl;\n          }\n\n       public:\n          Bar\u0026 Bar() { return bar_; }\n      };\n\n      int main() {\n          Hoge hoge;\n          hoge.Bar().func();\n          return 0;\n      }\n      ```\n  - [Why would one use nested classes in C++?](https://stackoverflow.com/questions/4571355/why-would-one-use-nested-classes-in-c)\n  - [Why is a type qualifier on a return type meaningless?](https://stackoverflow.com/questions/1607188/why-is-a-type-qualifier-on-a-return-type-meaningless)\n\n\n### ex00\n- [std::exception](https://cpprefjp.github.io/reference/exception/exception.html)\n  - `exception` クラスは，標準ライブラリが提供する全ての例外クラスの基底クラス．\n- nested classes\n- [Static constant string (class member)](https://stackoverflow.com/questions/1563897/static-constant-string-class-member)\n  - Before C++17\n    ```c++\n    // *.hpp\n    class A {\n    private:\n      static const string RECTANGLE;\n    };\n    // *.cpp\n    const string A::RECTANGLE = \"rectangle\";\n    ```\n  - After C++17\n    ```c++\n    // *.hpp\n    class A {\n    private:\n      inline static const string RECTANGLE = \"rectangle\";\n    };\n    ```\n- [Weird error on 'exception specification of overriding function is more lax than base version' in C++](https://stackoverflow.com/questions/59919357/weird-error-on-exception-specification-of-overriding-function-is-more-lax-than)\n- [exception specification of overriding function is more lax than base version](https://stackoverflow.com/questions/53829852/exception-specification-of-overriding-function-is-more-lax-than-base-version/53829972)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolareenlo%2F42cpp-module-05","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolareenlo%2F42cpp-module-05","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolareenlo%2F42cpp-module-05/lists"}