forked from Mq-b/Loser-HomeWork
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zturn
committed
Jan 16, 2024
1 parent
4183005
commit de0efda
Showing
6 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
name: Build and Run HomeWork | ||
name: Build HomeWork | ||
|
||
on: | ||
workflow_dispatch: | ||
# push: | ||
# branches: [ "main" ] | ||
push: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
CXX_Compiler: g++-13 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/build | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=$CXX_Compiler | ||
|
||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build | ||
|
||
- name: Run | ||
run: cmake --build ${{github.workspace}}/build --target run_all | ||
|
||
# 有等待输入的程序 | ||
# - name: Run | ||
# run: cmake --build ${{github.workspace}}/build --target run_all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
这个问题用名字查找来解释,如果不加`this`,首先在模板作用域内进行查找这个函数,如果没有,编译器认为是类外非成员函数。如果想调用父类模板的这个函数,需要加上作用域限定`X<T>::`或者`this->`。 | ||
为什么模板函数不能直接使用父类的方法,名字查找依赖于模板参数,我认为是模板参数的实际类型确定要根据实际实例化的类型最终确定,如果父类有特化并且没有这个函数,那么实例化后这个就应该报错。再往下有点理解不了了。 |