From ebb90e047be9c3ed0edc495d386102754f13b302 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Sun, 14 Nov 2021 22:13:00 -0800 Subject: [PATCH] Initial commit --- Makefile | 10 ++++++++++ helloworld.cc | 12 ++++++++++++ main.cc | 13 +++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 Makefile create mode 100644 helloworld.cc create mode 100644 main.cc 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; +} -- 2.25.1