forked from grantrostig/cpp_by_example
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmy_module.cpp
More file actions
34 lines (25 loc) · 878 Bytes
/
my_module.cpp
File metadata and controls
34 lines (25 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//module; // Optional keyword used to put old headers on subsequent lines, ONLY if necessary.
//#include "my_module.hpp"
//#include <iostream>
export module My_module; // No headers below (unless wanting only copy paste text inclusion.
//import <iostream>; // No yet.
//import std; // No yet.
//import std.compat; // No yet.
export int f( int );
//module : private; // This starts a private module fragment
export int f( int i ) {
return 3*i;
}
// *** other stuff
//export module My_module:My_partition_XXX;
///file: My_module-My_partition_b.cpp
//export module My_module:My_partion_b;
//...
///file: My_module-My_partion_c.cpp
//module My_module:My_partion_c;
//...
///file: My_module.cpp
//export module My_module;
//import :My_partion_c;
//export import :My_partion_b;
//...