aboutsummaryrefslogtreecommitdiff
path: root/examples/cppx_cppfront
diff options
context:
space:
mode:
authorRubén Rincón Blanco <ruben@rinconblanco.es>2022-09-17 09:54:43 +0200
committerGitHub <noreply@github.com>2022-09-17 09:54:43 +0200
commitace16d8aa5996677e82de89172bac53bb6e556f2 (patch)
treed50306bdadaa24b6fdf1594d2e6bb4eb0c26225b /examples/cppx_cppfront
parent817152f2f43de41c3eb0aad9d5108dc33fbb3bd2 (diff)
parentcf2da5f9b3b0745880c1896415e42f81c2bfca30 (diff)
downloadcompiler-explorer-gh-4251.tar.gz
compiler-explorer-gh-4251.zip
Merge branch 'main' into addbasecompilertypesgh-4251
Diffstat (limited to 'examples/cppx_cppfront')
-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";
+}