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

Function dynamicPointerCast

test/plugins/wasm_bpf/wasm_bpf.cpp:33–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32template <typename T, typename U>
33inline std::unique_ptr<T> dynamicPointerCast(std::unique_ptr<U> &&R) noexcept {
34 static_assert(std::has_virtual_destructor_v<T>);
35 T *P = dynamic_cast<T *>(R.get());
36 if (P) {
37 R.release();
38 }
39 return std::unique_ptr<T>(P);
40}
41
42std::unique_ptr<WasmEdge::Host::WasmBpfModule> createModule() {
43 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