Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xiao-ming-hub 完成了作业 #68

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

xiao-ming-hub
Copy link

每个 commit 都写了点东西,解释的写注释里了。拓展功能:

  • 支持基于范围的 for 循环。
  • 支持使用 std::initializer_liststd::vector 等 STL 容器初始化,第二个模板参数就是初始化时填的。
  • 使用 std::ostream 实例输出。

xiao-ming-hub added 4 commits January 18, 2023 15:08
写完后发现代码几乎和拷贝构造函数一样,于是就想着把它们合并起来。结
果发现构造函数不会写了。cppreference 说 std::ranges::range 可以实
现这个需求,但我的库不支持。我想把那一个函数写成模板(也是不会写)
所以多出来了一个参数,有点臃肿。

编译时会警告,我给 CMakeLists.txt 加上 target_compile_options(
main PUBLIC -std=c++20) 还是报(强迫症)。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant