From: Bernie Innocenti Date: Mon, 15 Nov 2021 06:13:00 +0000 (-0800) Subject: Initial commit X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;ds=sidebyside;h=ebb90e047be9c3ed0edc495d386102754f13b302;p=modules.git Initial commit --- ebb90e047be9c3ed0edc495d386102754f13b302 diff --git a/Makefile b/Makefile new file mode 100644 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 index 0000000..c2075f0 --- /dev/null +++ b/helloworld.cc @@ -0,0 +1,12 @@ +module; + +#include + +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 index 0000000..9221a35 --- /dev/null +++ b/main.cc @@ -0,0 +1,13 @@ +//#include + +import helloworld; +//import ; + +int main() { + //std::string s = "foo"; + + helloworld:HelloWorld h; + h.hello(); + + return 0; +}