【发布时间】:2020-06-30 18:27:53
【问题描述】:
为了就 C++20 中自写模块的问题/功能提出问题或演示,如果能够使用 Matt Godbolt's compiler explorer,那就太好了。
示例:
test.cpp(模块测试):
export module test;
export template<typename T>
void do_something(const T&)
{
}
使用clang++ -std=c++20 -stdlib=libc++ -fmodules -c -Xclang -emit-module-interface -o test.pcm test.cpp编译
main.cpp:
import test;
int main() {
do_something(7);
}
用clang++ -std=c++20 -stdlib=libc++ -fmodules -fimplicit-modules -fimplicit-module-maps -fprebuilt-module-path=. main.cpp编译
问:有没有办法通过编译器资源管理器做到这一点?
【问题讨论】:
标签: c++ c++20 c++-modules compiler-explorer