We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d66dec9 commit 24b4376Copy full SHA for 24b4376
modules/imports/imported.cppm
@@ -0,0 +1,13 @@
1
+module;
2
+
3
+#include <cassert>
4
5
+export module imported;
6
7
+import<string>;
8
9
+export std::string foo(int n) {
10
+ assert(n < 42 && "argument shall be less than 42");
11
+ return "Hello, world!";
12
+}
13
modules/imports/main.cc
@@ -0,0 +1,7 @@
+#include <iostream>
+import imported;
+int main() {
+ std::cout << "foo: " << foo(0) << std::endl;
modules/imports/runme.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+CXX=clang++-18
+${CXX} --std=c++23 -fmodules --stdlib=libc++ --precompile imported.cppm -o imported.pcm
+${CXX} --std=c++23 -fmodules --stdlib=libc++ -fmodule-file=imported=imported.pcm imported.pcm main.cc
0 commit comments