♻️ 使用module重构所有代码
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
module;
|
||||
|
||||
import std;
|
||||
|
||||
export module math;
|
||||
|
||||
namespace math
|
||||
{
|
||||
export int add(int a, int b)
|
||||
{
|
||||
return a + b;
|
||||
}
|
||||
|
||||
export void print_sum(int a, int b)
|
||||
{
|
||||
std::cout << a << " + " << b << " = " << add(a, b) << "\n";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user