From 5c3b7c4b1ba047e5f97f4b04002fdc2d0d61b3a0 Mon Sep 17 00:00:00 2001 From: ninemine <1371605831@qq.com> Date: Thu, 21 Aug 2025 15:49:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 3 +++ Convention/[Static] | 1 + README.md | 33 +++++++++++++++++++++++++++++++++ [Test]/test.cpp | 22 ++++++++++++++++++++-- 4 files changed, 57 insertions(+), 2 deletions(-) create mode 160000 Convention/[Static] create mode 100644 README.md diff --git a/.gitmodules b/.gitmodules index 5530f41..490c0a3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "Convention/[nlohmann]"] path = Convention/[nlohmann] url = https://github.com/nlohmann/json.git +[submodule "Convention/[Static]"] + path = Convention/[Static] + url = https://github.com/NINEMINEsigma/ModernCPP.git diff --git a/Convention/[Static] b/Convention/[Static] new file mode 160000 index 0000000..004f2f3 --- /dev/null +++ b/Convention/[Static] @@ -0,0 +1 @@ +Subproject commit 004f2f336733df6d67f221f95b94e59e2c6e6d36 diff --git a/README.md b/README.md new file mode 100644 index 0000000..746c71e --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# 前置要求 + +- **编译器**: 支持C++17的编译器 (GCC 7+, Clang 5+, MSVC 2017+) +- **CMake**: 3.14或更高版本 +- **Git**: 用于克隆子模块 + +# 克隆项目 + +由于项目包含Git子模块,请使用以下命令进行完整克隆: + +```bash +# 方法1: 递归克隆(推荐) +git clone --recursive https://github.com/your-username/Convention-CPP.git +cd Convention-CPP + +# 方法2: 先克隆主项目,再初始化子模块 +git clone https://github.com/your-username/Convention-CPP.git +cd Convention-CPP +git submodule update --init --recursive +``` + +# 更新子模块 + +如果子模块有更新,使用以下命令: + +```bash +# 更新所有子模块到最新版本 +git submodule update --remote + +# 或者更新特定子模块 +git submodule update --remote Convention/[nlohmann] +git submodule update --remote Convention/[Static] +``` diff --git a/[Test]/test.cpp b/[Test]/test.cpp index c15c27e..48fdd8a 100644 --- a/[Test]/test.cpp +++ b/[Test]/test.cpp @@ -1,10 +1,28 @@ #include -#include using namespace std; using namespace Convention; +class A +{ +public: + virtual void a() {} +}; + +class B +{ +public: + virtual void b() {} +}; + +class C :public A, protected B +{ +public: + virtual void c() {} +}; + int main() { - cout << ProjectConfig().LoadProperties().FindItem("test", "test") << endl; + C c; + ((A)c).a(); }