文件 cpp_98_stl.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
gmake: Warning: File 'Makefile' has modification time 0.22 s in the future
gmake[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.35 s in the future
gmake[2]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.28 s in the future
gmake[3]: Warning: File 'CMakeFiles/cpp_98_stl.dir/progress.make' has modification time 0.22 s in the future
[35m[1mConsolidate compiler generated dependencies of target cpp_98_stl[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
gmake[3]: Warning: File 'CMakeFiles/cpp_98_stl.dir/progress.make' has modification time 0.06 s in the future
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_98_stl.dir/cpp_98_stl.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_98_stl[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target cpp_98_stl
gmake[2]: warning: Clock skew detected. Your build may be incomplete.
gmake[1]: warning: Clock skew detected. Your build may be incomplete.
gmake: warning: Clock skew detected. Your build may be incomplete.
10
文件 cpp_11_lambda.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
[35m[1mConsolidate compiler generated dependencies of target cpp_11_lambda[0m
gmake[3]: Warning: File 'CMakeFiles/cpp_11_lambda.dir/compiler_depend.make' has modification time 0.19 s in the future
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_11_lambda.dir/cpp_11_lambda.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_11_lambda[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target cpp_11_lambda
10
文件 cpp_11_range_based_for_loop.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
[35m[1mConsolidate compiler generated dependencies of target cpp_11_range_based_for_loop[0m
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_11_range_based_for_loop.dir/cpp_11_range_based_for_loop.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_11_range_based_for_loop[0m
[100%] Built target cpp_11_range_based_for_loop
10
文件 cpp_11_for_each.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
[35m[1mConsolidate compiler generated dependencies of target cpp_11_for_each[0m
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_11_for_each.dir/cpp_11_for_each.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_11_for_each[0m
[100%] Built target cpp_11_for_each
10
文件 cpp_11_lambda_expression.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
[35m[1mConsolidate compiler generated dependencies of target cpp_11_lambda_expression[0m
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_11_lambda_expression.dir/cpp_11_lambda_expression.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_11_lambda_expression[0m
[100%] Built target cpp_11_lambda_expression
10
文件 cpp_14_lambda_auto.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
文件 cpp_98_stl.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
[35m[1mConsolidate compiler generated dependencies of target cpp_98_stl[0m
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_98_stl.dir/cpp_98_stl.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_98_stl[0m
[100%] Built target cpp_98_stl
10
文件 cpp_11_lambda.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
gmake[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 1.6 s in the future
gmake[2]: Warning: File 'CMakeFiles/Makefile2' has modification time 1.6 s in the future
gmake[3]: Warning: File 'CMakeFiles/cpp_11_lambda.dir/progress.make' has modification time 1.5 s in the future
[35m[1mConsolidate compiler generated dependencies of target cpp_11_lambda[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
gmake[3]: Warning: File 'CMakeFiles/cpp_11_lambda.dir/progress.make' has modification time 1.1 s in the future
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_11_lambda.dir/cpp_11_lambda.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_11_lambda[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target cpp_11_lambda
gmake[2]: warning: Clock skew detected. Your build may be incomplete.
gmake[1]: warning: Clock skew detected. Your build may be incomplete.
10
文件 cpp_11_range_based_for_loop.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
gmake: Warning: File 'Makefile' has modification time 1.4 s in the future
gmake[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 1.4 s in the future
gmake[2]: Warning: File 'CMakeFiles/Makefile2' has modification time 1.3 s in the future
gmake[3]: Warning: File 'CMakeFiles/cpp_11_range_based_for_loop.dir/progress.make' has modification time 1.2 s in the future
[35m[1mConsolidate compiler generated dependencies of target cpp_11_range_based_for_loop[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
gmake[3]: Warning: File 'CMakeFiles/cpp_11_range_based_for_loop.dir/progress.make' has modification time 0.75 s in the future
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_11_range_based_for_loop.dir/cpp_11_range_based_for_loop.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_11_range_based_for_loop[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target cpp_11_range_based_for_loop
gmake[2]: warning: Clock skew detected. Your build may be incomplete.
gmake[1]: warning: Clock skew detected. Your build may be incomplete.
gmake: warning: Clock skew detected. Your build may be incomplete.
10
文件 cpp_11_for_each.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
gmake: Warning: File 'Makefile' has modification time 1.1 s in the future
gmake[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 1.2 s in the future
gmake[2]: Warning: File 'CMakeFiles/Makefile2' has modification time 1.1 s in the future
gmake[3]: Warning: File 'CMakeFiles/cpp_11_for_each.dir/progress.make' has modification time 0.96 s in the future
[35m[1mConsolidate compiler generated dependencies of target cpp_11_for_each[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
gmake[3]: Warning: File 'CMakeFiles/cpp_11_for_each.dir/progress.make' has modification time 0.51 s in the future
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_11_for_each.dir/cpp_11_for_each.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_11_for_each[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target cpp_11_for_each
gmake[2]: warning: Clock skew detected. Your build may be incomplete.
gmake[1]: warning: Clock skew detected. Your build may be incomplete.
gmake: warning: Clock skew detected. Your build may be incomplete.
10
文件 cpp_11_lambda_expression.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
gmake: Warning: File 'Makefile' has modification time 0.97 s in the future
gmake[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 1 s in the future
gmake[2]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.91 s in the future
gmake[3]: Warning: File 'CMakeFiles/cpp_11_lambda_expression.dir/progress.make' has modification time 0.84 s in the future
[35m[1mConsolidate compiler generated dependencies of target cpp_11_lambda_expression[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
gmake[3]: Warning: File 'CMakeFiles/cpp_11_lambda_expression.dir/progress.make' has modification time 0.49 s in the future
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_11_lambda_expression.dir/cpp_11_lambda_expression.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_11_lambda_expression[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target cpp_11_lambda_expression
gmake[2]: warning: Clock skew detected. Your build may be incomplete.
gmake[1]: warning: Clock skew detected. Your build may be incomplete.
gmake: warning: Clock skew detected. Your build may be incomplete.
10
文件 cpp_14_lambda_auto.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
gmake: Warning: File 'Makefile' has modification time 0.68 s in the future
gmake[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.72 s in the future
gmake[2]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.56 s in the future
gmake[3]: Warning: File 'CMakeFiles/cpp_14_lambda_auto.dir/progress.make' has modification time 0.46 s in the future
[35m[1mConsolidate compiler generated dependencies of target cpp_14_lambda_auto[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
gmake[3]: Warning: File 'CMakeFiles/cpp_14_lambda_auto.dir/compiler_depend.make' has modification time 0.88 s in the future
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_14_lambda_auto.dir/cpp_14_lambda_auto.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_14_lambda_auto[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target cpp_14_lambda_auto
gmake[2]: warning: Clock skew detected. Your build may be incomplete.
gmake[1]: warning: Clock skew detected. Your build may be incomplete.
gmake: warning: Clock skew detected. Your build may be incomplete.
10
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
gmake: Warning: File 'Makefile' has modification time 0.48 s in the future
gmake[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.61 s in the future
gmake[2]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.53 s in the future
gmake[3]: Warning: File 'CMakeFiles/cpp_14_lambda_auto.dir/progress.make' has modification time 0.44 s in the future
[35m[1mConsolidate compiler generated dependencies of target cpp_14_lambda_auto[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
gmake[3]: Warning: File 'CMakeFiles/cpp_14_lambda_auto.dir/progress.make' has modification time 0.15 s in the future
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target cpp_14_lambda_auto
gmake[2]: warning: Clock skew detected. Your build may be incomplete.
gmake[1]: warning: Clock skew detected. Your build may be incomplete.
gmake: warning: Clock skew detected. Your build may be incomplete.
10
文件 cpp_17_CTAD.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
gmake: Warning: File 'Makefile' has modification time 0.35 s in the future
gmake[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.45 s in the future
gmake[2]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.34 s in the future
gmake[3]: Warning: File 'CMakeFiles/cpp_17_CTAD.dir/progress.make' has modification time 0.23 s in the future
[35m[1mConsolidate compiler generated dependencies of target cpp_17_CTAD[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
gmake[3]: Warning: File 'CMakeFiles/cpp_17_CTAD.dir/compiler_depend.make' has modification time 0.51 s in the future
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_17_CTAD.dir/cpp_17_CTAD.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_17_CTAD[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target cpp_17_CTAD
gmake[2]: warning: Clock skew detected. Your build may be incomplete.
gmake[1]: warning: Clock skew detected. Your build may be incomplete.
gmake: warning: Clock skew detected. Your build may be incomplete.
10
文件 cpp_17_numeric.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
gmake[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.12 s in the future
gmake[2]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.0069 s in the future
[35m[1mConsolidate compiler generated dependencies of target cpp_17_numeric[0m
gmake[3]: Warning: File 'CMakeFiles/cpp_17_numeric.dir/compiler_depend.make' has modification time 0.33 s in the future
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_17_numeric.dir/cpp_17_numeric.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_17_numeric[0m
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target cpp_17_numeric
gmake[2]: warning: Clock skew detected. Your build may be incomplete.
gmake[1]: warning: Clock skew detected. Your build may be incomplete.
10
%%gadget -c cpp_20_ranges.cpp
#include<vector>
#include<iostream>
#include<numeric>
#include<ranges>
#include<cmath>
int main(){
std::vector v = {4, 3, 2, 1, 0, -1, -2};
for (auto &&vi : v
| std::views::filter([](auto &&x) {return x >= 0; })
| std::views::transform([] (auto &&x) { return sqrtf(x); })
){
std::cout << vi << std::endl;
}
return 0;
}
文件 cpp_20_ranges.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
[35m[1mConsolidate compiler generated dependencies of target cpp_20_ranges[0m
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_20_ranges.dir/cpp_20_ranges.cpp.o[0m
[100%] [32m[1mLinking CXX executable cpp_20_ranges[0m
[100%] Built target cpp_20_ranges
2
1.73205
1.41421
1
0
%%gadget -c cpp_20_module.cpp
import <vector>;
import <iostream>;
import <numeric>;
import <ranges>;
import <cmath>;
int main(){
std::vector v = {4, 3, 2, 1, 0, -1, -2};
for (auto &&vi : v
| std::views::filter([](auto &&x) {return x >= 0; })
| std::views::transform([] (auto &&x) { return sqrtf(x); })
){
std::cout << vi << std::endl;
}
return 0;
}
文件 cpp_20_module.cpp 创建成功,内容已写入。
文件 CMakeLists.txt 创建成功,内容已写入。
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/build
[35m[1mConsolidate compiler generated dependencies of target cpp_20_module[0m
[ 50%] [32mBuilding CXX object CMakeFiles/cpp_20_module.dir/cpp_20_module.cpp.o[0m
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:2:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kvector[m[K’ was not declared in this scope
2 | import <[01;31m[Kvector[m[K>;
| [01;31m[K^~~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:2:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kvector[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:2:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kvector[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:2:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kvector[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:2:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kvector[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:2:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kvector[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:2:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kvector[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:2:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kvector[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:2:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kvector[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:2:1:[m[K [01;31m[Kerror: [m[K‘[01m[Kimport[m[K’ does not name a type
2 | [01;31m[Kimport[m[K <vector>;
| [01;31m[K^~~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:2:1:[m[K [01;36m[Knote: [m[KC++20 ‘[01m[Kimport[m[K’ only available with ‘[01m[K-fmodules-ts[m[K’, which is not yet enabled with ‘[01m[K-std=c++20[m[K’
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:3:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kiostream[m[K’ was not declared in this scope
3 | import <[01;31m[Kiostream[m[K>;
| [01;31m[K^~~~~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:3:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kiostream[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:3:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kiostream[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:3:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kiostream[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:3:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kiostream[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:3:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kiostream[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:3:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kiostream[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:3:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kiostream[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:3:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kiostream[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:3:1:[m[K [01;31m[Kerror: [m[K‘[01m[Kimport[m[K’ does not name a type
3 | [01;31m[Kimport[m[K <iostream>;
| [01;31m[K^~~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:3:1:[m[K [01;36m[Knote: [m[KC++20 ‘[01m[Kimport[m[K’ only available with ‘[01m[K-fmodules-ts[m[K’, which is not yet enabled with ‘[01m[K-std=c++20[m[K’
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:4:9:[m[K [01;31m[Kerror: [m[K‘[01m[Knumeric[m[K’ was not declared in this scope
4 | import <[01;31m[Knumeric[m[K>;
| [01;31m[K^~~~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:4:9:[m[K [01;31m[Kerror: [m[K‘[01m[Knumeric[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:4:9:[m[K [01;31m[Kerror: [m[K‘[01m[Knumeric[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:4:9:[m[K [01;31m[Kerror: [m[K‘[01m[Knumeric[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:4:9:[m[K [01;31m[Kerror: [m[K‘[01m[Knumeric[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:4:9:[m[K [01;31m[Kerror: [m[K‘[01m[Knumeric[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:4:9:[m[K [01;31m[Kerror: [m[K‘[01m[Knumeric[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:4:9:[m[K [01;31m[Kerror: [m[K‘[01m[Knumeric[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:4:9:[m[K [01;31m[Kerror: [m[K‘[01m[Knumeric[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:4:1:[m[K [01;31m[Kerror: [m[K‘[01m[Kimport[m[K’ does not name a type
4 | [01;31m[Kimport[m[K <numeric>;
| [01;31m[K^~~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:4:1:[m[K [01;36m[Knote: [m[KC++20 ‘[01m[Kimport[m[K’ only available with ‘[01m[K-fmodules-ts[m[K’, which is not yet enabled with ‘[01m[K-std=c++20[m[K’
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:5:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kranges[m[K’ was not declared in this scope
5 | import <[01;31m[Kranges[m[K>;
| [01;31m[K^~~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:5:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kranges[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:5:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kranges[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:5:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kranges[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:5:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kranges[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:5:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kranges[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:5:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kranges[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:5:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kranges[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:5:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kranges[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:5:1:[m[K [01;31m[Kerror: [m[K‘[01m[Kimport[m[K’ does not name a type
5 | [01;31m[Kimport[m[K <ranges>;
| [01;31m[K^~~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:5:1:[m[K [01;36m[Knote: [m[KC++20 ‘[01m[Kimport[m[K’ only available with ‘[01m[K-fmodules-ts[m[K’, which is not yet enabled with ‘[01m[K-std=c++20[m[K’
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:6:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kcmath[m[K’ was not declared in this scope
6 | import <[01;31m[Kcmath[m[K>;
| [01;31m[K^~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:6:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kcmath[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:6:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kcmath[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:6:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kcmath[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:6:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kcmath[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:6:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kcmath[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:6:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kcmath[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:6:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kcmath[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:6:9:[m[K [01;31m[Kerror: [m[K‘[01m[Kcmath[m[K’ was not declared in this scope
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:6:1:[m[K [01;31m[Kerror: [m[K‘[01m[Kimport[m[K’ does not name a type
6 | [01;31m[Kimport[m[K <cmath>;
| [01;31m[K^~~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:6:1:[m[K [01;36m[Knote: [m[KC++20 ‘[01m[Kimport[m[K’ only available with ‘[01m[K-fmodules-ts[m[K’, which is not yet enabled with ‘[01m[K-std=c++20[m[K’
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:[m[K In function ‘[01m[Kint main()[m[K’:
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:9:10:[m[K [01;31m[Kerror: [m[K‘[01m[Kvector[m[K’ is not a member of ‘[01m[Kstd[m[K’
9 | std::[01;31m[Kvector[m[K v = {4, 3, 2, 1, 0, -1, -2};
| [01;31m[K^~~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:1:1:[m[K [01;36m[Knote: [m[K‘[01m[Kstd::vector[m[K’ is defined in header ‘[01m[K<vector>[m[K’; did you forget to ‘[01m[K#include <vector>[m[K’?
+++ |+[32m[K#include <vector>[m[K
1 |
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:10:22:[m[K [01;31m[Kerror: [m[K‘[01m[Kv[m[K’ was not declared in this scope; did you mean ‘[01m[Kvi[m[K’?
10 | for (auto &&vi : [01;31m[Kv[m[K
| [01;31m[K^[m[K
| [32m[Kvi[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:11:13:[m[K [01;31m[Kerror: [m[K‘[01m[Kstd::views[m[K’ has not been declared
11 | | std::[01;31m[Kviews[m[K::filter([](auto &&x) {return x >= 0; })
| [01;31m[K^~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:12:13:[m[K [01;31m[Kerror: [m[K‘[01m[Kstd::views[m[K’ has not been declared
12 | | std::[01;31m[Kviews[m[K::transform([] (auto &&x) { return sqrtf(x); })
| [01;31m[K^~~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:14:14:[m[K [01;31m[Kerror: [m[K‘[01m[Kcout[m[K’ is not a member of ‘[01m[Kstd[m[K’
14 | std::[01;31m[Kcout[m[K << vi << std::endl;
| [01;31m[K^~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:1:1:[m[K [01;36m[Knote: [m[K‘[01m[Kstd::cout[m[K’ is defined in header ‘[01m[K<iostream>[m[K’; did you forget to ‘[01m[K#include <iostream>[m[K’?
+++ |+[32m[K#include <iostream>[m[K
1 |
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:14:33:[m[K [01;31m[Kerror: [m[K‘[01m[Kendl[m[K’ is not a member of ‘[01m[Kstd[m[K’
14 | std::cout << vi << std::[01;31m[Kendl[m[K;
| [01;31m[K^~~~[m[K
[01m[K/mnt/c/Users/Jeff/Desktop/cpp_course_from_scratch/cpp_20_module.cpp:1:1:[m[K [01;36m[Knote: [m[K‘[01m[Kstd::endl[m[K’ is defined in header ‘[01m[K<ostream>[m[K’; did you forget to ‘[01m[K#include <ostream>[m[K’?
+++ |+[32m[K#include <ostream>[m[K
1 |
gmake[3]: *** [CMakeFiles/cpp_20_module.dir/build.make:76: CMakeFiles/cpp_20_module.dir/cpp_20_module.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/cpp_20_module.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/cpp_20_module.dir/rule] Error 2
gmake: *** [Makefile:124: cpp_20_module] Error 2
/bin/bash: line 1: build/cpp_20_module: No such file or directory
%%gadget -c cpp_20_module.cpp
import std.vector;
import std.iostream;
import std.numeric;
import std.ranges;
import std.cmath;
int main(){
std::vector v = {4, 3, 2, 1, 0, -1, -2};
for (auto &&vi : v
| std::views::filter([](auto &&x) {return x >= 0; })
| std::views::transform([] (auto &&x) { return sqrtf(x); })
){
std::cout << vi << std::endl;
}
return 0;
}
文件 cpp_20_module.cpp 创建成功,内容已写入。
[01m[Kg++-10:[m[K [01;31m[Kerror: [m[Kunrecognized command-line option ‘[01m[K-fmodules-ts[m[K’; did you mean ‘[01m[K-fmodules[m[K’?
%%gadget -c cpp_20_module.cpp
import <vector>;
import <iostream>;
import <numeric>;
import <ranges>;
import <cmath>;
int main(){
std::vector v = {4, 3, 2, 1, 0, -1, -2};
for (auto &&vi : v
| std::views::filter([](auto &&x) {return x >= 0; })
| std::views::transform([] (auto &&x) { return sqrtf(x); })
){
std::cout << vi << std::endl;
}
return 0;
}
文件 cpp_20_module.cpp 创建成功,内容已写入。
[1m./cpp_20_module.cpp:2:8: [0m[0;1;31merror: [0m[1mheader file <vector> (aka '/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/vector') cannot be imported because it is not known to be a header unit[0m
import <vector>;
[0;1;32m ^
[0m[1m./cpp_20_module.cpp:3:8: [0m[0;1;31merror: [0m[1mheader file <iostream> (aka '/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/iostream') cannot be imported because it is not known to be a header unit[0m
import <iostream>;
[0;1;32m ^
[0m[1m./cpp_20_module.cpp:4:8: [0m[0;1;31merror: [0m[1mheader file <numeric> (aka '/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/numeric') cannot be imported because it is not known to be a header unit[0m
import <numeric>;
[0;1;32m ^
[0m[1m./cpp_20_module.cpp:5:8: [0m[0;1;31merror: [0m[1mheader file <ranges> (aka '/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/ranges') cannot be imported because it is not known to be a header unit[0m
import <ranges>;
[0;1;32m ^
[0m[1m./cpp_20_module.cpp:6:8: [0m[0;1;31merror: [0m[1mheader file <cmath> (aka '/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/cmath') cannot be imported because it is not known to be a header unit[0m
import <cmath>;
[0;1;32m ^
[0m[1m./cpp_20_module.cpp:9:5: [0m[0;1;31merror: [0m[1muse of undeclared identifier 'std'[0m
std::vector v = {4, 3, 2, 1, 0, -1, -2};
[0;1;32m ^
[0m[1m./cpp_20_module.cpp:11:8: [0m[0;1;31merror: [0m[1muse of undeclared identifier 'std'[0m
| std::views::filter([](auto &&x) {return x >= 0; })
[0;1;32m ^
[0m[1m./cpp_20_module.cpp:12:8: [0m[0;1;31merror: [0m[1muse of undeclared identifier 'std'[0m
| std::views::transform([] (auto &&x) { return sqrtf(x); })
[0;1;32m ^
[0m[1m./cpp_20_module.cpp:14:9: [0m[0;1;31merror: [0m[1muse of undeclared identifier 'std'[0m
std::cout << vi << std::endl;
[0;1;32m ^
[0m[1m./cpp_20_module.cpp:14:28: [0m[0;1;31merror: [0m[1muse of undeclared identifier 'std'[0m
std::cout << vi << std::endl;
[0;1;32m ^
[0m10 errors generated.
%%gadget -c cpp_20_module_auto.cpp
import <vector>;
import <iostream>;
import <numeric>;
import <ranges>;
import <cmath>;
void myfunc(auto &&v){
for (auto &&vi : v
| std::views::filter([](auto &&x) {return x >= 0; })
| std::views::transform([] (auto &&x) { return sqrtf(x); })
){
std::cout << vi << std::endl;
}
}
int main(){
std::vector v = {4, 3, 2, 1, 0, -1, -2};
myfunc(v);
return 0;
}
文件 cpp_20_module_auto.cpp 创建成功,内容已写入。
%%gadget -c cpp_20_coroutine_generator.cpp
import <vector>;
import <iostream>;
import <numeric>;
import <ranges>;
import <cmath>;
import <generator>;
std::generator<int> myfunc(auto &&v){
for (auto &&vi : v
| std::views::filter([](auto &&x) {return x >= 0; })
| std::views::transform([] (auto &&x) { return sqrtf(x); })
){
co_yield vi;
}
}
int main(){
std::vector v = {4, 3, 2, 1, 0, -1, -2};
for (auto &&vi : myfunc(v))
std::cout << vi << std::endl;
return 0;
}
文件 cpp_20_coroutine_generator.cpp 创建成功,内容已写入。
%%gadget -c cpp_20_coroutine_generator_format.cpp
import <vector>;
import <iostream>;
import <numeric>;
import <ranges>;
import <cmath>;
import <generator>;
std::generator<int> myfunc(auto &&v){
for (auto &&vi : v
| std::views::filter([](auto &&x) {return x >= 0; })
| std::views::transform([] (auto &&x) { return sqrtf(x); })
){
co_yield vi;
}
}
int main(){
std::vector v = {4, 3, 2, 1, 0, -1, -2};
for (auto &&vi : myfunc(v))
std::format_to(std::cout, "num is: {}\n", vi);
return 0;
}
文件 cpp_20_coroutine_generator_format.cpp 创建成功,内容已写入。