mcpplibs templates...
src/templates.cppm
module; // 0 - global module declaration
// 1 - include & macro area
// #include <stdio.h>
// 2 - module declaration
export module mcpplibs.templates;
// 3 - import area
import std;
// 4 - module implementation partition
namespace mcpplibs {
// 5 - exported entities
export void hello_mcpp() {
std::println("hello mcpp!");
}
} // namespace mcpplibstests/main.cpp
// 6 - import module
import mcpplibs.templates;
auto main() -> int {
// 7 - call exported function
mcpplibs::hello_mcpp();
}xlings installUsing xmake
xmake build
xmake rUsing CMake
cmake -B build -G Ninja
cmake --build build
./build/tests