From 4207d33d79566110f1f1649036f23696533a898b Mon Sep 17 00:00:00 2001 From: sha512sum Date: Fri, 1 Mar 2024 17:08:25 +0000 Subject: [PATCH] Add example to GoInterface --- examples/src/go_interface.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 examples/src/go_interface.cpp diff --git a/examples/src/go_interface.cpp b/examples/src/go_interface.cpp new file mode 100644 index 0000000..73ed557 --- /dev/null +++ b/examples/src/go_interface.cpp @@ -0,0 +1,21 @@ +#include +#include + +struct SomeInterfaceImpl { + int a; + int b; +}; +using SomeInterface = utempl::GoInterface; +struct SomeStruct { + short a; + short b; +}; + +inline auto Func(SomeInterface arg) { + fmt::print("{} {}\n", arg.a, arg.b); +}; + + +auto main() -> int { + Func(SomeStruct{42, 300}); +};