Add example to GoInterface

This commit is contained in:
sha512sum 2024-03-01 17:08:25 +00:00
parent e32c9f22f2
commit 4207d33d79

View file

@ -0,0 +1,21 @@
#include <utempl/go_interface.hpp>
#include <fmt/core.h>
struct SomeInterfaceImpl {
int a;
int b;
};
using SomeInterface = utempl::GoInterface<SomeInterfaceImpl>;
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});
};