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

Method RoundtripOption

tests/runtime/variants/test.cpp:7–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace test_exports = ::exports::test::variants::to_test;
6
7std::optional<uint8_t> test_exports::RoundtripOption(std::optional<float> a) {
8 if (a.has_value()) {
9 return std::optional<uint8_t>(a);
10 } else {
11 return std::optional<uint8_t>();
12 }
13}
14
15std::expected<double, uint8_t> test_exports::RoundtripResult(std::expected<uint32_t, float> a) {
16 if (a.has_value()) {

Callers 2

RunFunction · 0.45
RunMethod · 0.45

Calls 1

has_valueMethod · 0.45

Tested by

no test coverage detected