--- /dev/null
+CXXFLAGS = -fmodules-ts -std=c++20
+CC = g++
+
+main: main.o helloworld.o
+
+clean:
+ rm main *.o
+
+main.o: main.cc
+helloworld.o: helloworld.cc
--- /dev/null
+module;
+
+#include <iostream>
+
+export module helloworld;
+
+export class HelloWorld {
+public:
+ void hello() {
+ std::cout << "hello\n";
+ }
+};
--- /dev/null
+//#include <string>
+
+import helloworld;
+//import <string>;
+
+int main() {
+ //std::string s = "foo";
+
+ helloworld:HelloWorld h;
+ h.hello();
+
+ return 0;
+}