diff options
author | Rubén Rincón Blanco <ruben@rinconblanco.es> | 2022-09-17 09:54:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-17 09:54:43 +0200 |
commit | ace16d8aa5996677e82de89172bac53bb6e556f2 (patch) | |
tree | d50306bdadaa24b6fdf1594d2e6bb4eb0c26225b /examples/cppx_cppfront | |
parent | 817152f2f43de41c3eb0aad9d5108dc33fbb3bd2 (diff) | |
parent | cf2da5f9b3b0745880c1896415e42f81c2bfca30 (diff) | |
download | compiler-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.cpp2 | 17 |
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"; +} |