MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / dynamicPointerCast

Function dynamicPointerCast

test/plugins/wasi_logging/wasi_logging.cpp:17–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16template <typename T, typename U>
17inline std::unique_ptr<T> dynamicPointerCast(std::unique_ptr<U> &&R) noexcept {
18 static_assert(std::has_virtual_destructor_v<T>);
19 T *P = dynamic_cast<T *>(R.get());
20 if (P) {
21 R.release();
22 }
23 return std::unique_ptr<T>(P);
24}
25
26std::unique_ptr<WasmEdge::Host::WasiLoggingModule> createModule() {
27 using namespace std::literals::string_view_literals;

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected