aboutsummaryrefslogtreecommitdiff
path: root/examples/cppx_cppfront/default.cpp2
diff options
context:
space:
mode:
authorMatt Godbolt <matt@godbolt.org>2022-09-16 18:27:48 -0500
committerGitHub <noreply@github.com>2022-09-16 18:27:48 -0500
commitcf2da5f9b3b0745880c1896415e42f81c2bfca30 (patch)
treef491c35645314d72998518c8ece39267d837da6b /examples/cppx_cppfront/default.cpp2
parent2556bc5bb35d7313f6dd5266d37a1cad1ad226fb (diff)
downloadcompiler-explorer-cf2da5f9b3b0745880c1896415e42f81c2bfca30.tar.gz
compiler-explorer-cf2da5f9b3b0745880c1896415e42f81c2bfca30.zip
cppfront (#4069)gh-4247
Diffstat (limited to 'examples/cppx_cppfront/default.cpp2')
-rw-r--r--examples/cppx_cppfront/default.cpp217
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/cppx_cppfront/default.cpp2 b/examples/cppx_cppfront/default.cpp2
new file mode 100644
index 000000000..99fc51b6c
--- /dev/null
+++ b/examples/cppx_cppfront/default.cpp2
@@ -0,0 +1,17 @@
+#include <iostream>
+#include <string>
+
+name: () -> std::string = {
+ s: std::string = "world";
+ decorate(s);
+ return s;
+}
+
+decorate: (inout s: std::string) = {
+ s = "[" + s + "]";
+}
+
+auto main() -> int {
+ // name();
+ std::cout << "Hello " << name() << "\n";
+}