Skip to content

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