diff options
author | Matt Godbolt <matt@godbolt.org> | 2022-09-16 18:27:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-16 18:27:48 -0500 |
commit | cf2da5f9b3b0745880c1896415e42f81c2bfca30 (patch) | |
tree | f491c35645314d72998518c8ece39267d837da6b /examples/cppx_cppfront/default.cpp2 | |
parent | 2556bc5bb35d7313f6dd5266d37a1cad1ad226fb (diff) | |
download | compiler-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.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"; +} |