MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / RoundtripResult

Method RoundtripResult

tests/runtime/variants/test.cpp:15–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15std::expected<double, uint8_t> test_exports::RoundtripResult(std::expected<uint32_t, float> a) {
16 if (a.has_value()) {
17 return std::expected<double, uint8_t>(double(a.value()));
18 } else {
19 return std::expected<double, uint8_t>(std::unexpected(uint8_t(a.error())));
20 }
21}
22
23test_exports::E1 test_exports::RoundtripEnum(test_exports::E1 a) {
24 return a;

Callers 2

RunFunction · 0.45
RunMethod · 0.45

Calls 2

unexpectedClass · 0.85
has_valueMethod · 0.45

Tested by

no test coverage detected