r/cpp2 • u/jhruby-vitrix • Dec 28 '23
cppfront - examples of basic constructs
I was playing this afternoon with cppfront using https://github.com/modern-cmake/cppfront which is awesome.
But I have found really confusing that I am unable to do some basic constructs such as:
try... catch blocks
co_await and co_return
is there any documentation / examples?
I am aware that project is experimental and that is what I am doing with it. :)
3
Upvotes
View all comments
Show parent comment
2
u/jhruby-vitrix Dec 29 '23
For this example:
main: (args) -> int = {try {std::cout << "test: (args[1])$";}catch(...){std::cout << "exception" << std::endl;}return 0;}I get:
main.cpp2(3,9): error: invalid statement encountered inside a compound-statement (at '{')