dev: add module example

This commit is contained in:
Myriad-Dreamin
2026-04-04 00:04:55 +08:00
parent ed8b8b7745
commit 511b71f19a
4 changed files with 68 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
module;
#include <string>
#include <string_view>
export module sample.greeting;
export namespace sample {
std::string build_module_greeting(std::string_view name) {
return "Hello, " + std::string(name) + " from the C++20 module sample.";
}
}