Initial commit
authorBernie Innocenti <bernie@codewiz.org>
Mon, 15 Nov 2021 06:13:00 +0000 (22:13 -0800)
committerBernie Innocenti <bernie@codewiz.org>
Mon, 15 Nov 2021 06:13:00 +0000 (22:13 -0800)
Makefile [new file with mode: 0644]
helloworld.cc [new file with mode: 0644]
main.cc [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..baae783
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,10 @@
+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
diff --git a/helloworld.cc b/helloworld.cc
new file mode 100644 (file)
index 0000000..c2075f0
--- /dev/null
@@ -0,0 +1,12 @@
+module;
+
+#include <iostream>
+
+export module helloworld;
+
+export class HelloWorld {
+public:
+    void hello() {
+        std::cout << "hello\n";
+    }
+};
diff --git a/main.cc b/main.cc
new file mode 100644 (file)
index 0000000..9221a35
--- /dev/null
+++ b/main.cc
@@ -0,0 +1,13 @@
+//#include <string>
+
+import helloworld;
+//import <string>;
+
+int main() {
+    //std::string s = "foo";
+
+    helloworld:HelloWorld h;
+    h.hello();
+
+    return 0;
+}