hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.4K
active users

Šimon Tóth

A typical pattern with legacy APIs is for the initializing function to return an opaque pointer that needs to be freed by manually calling a cleanup function.

std::unique_ptr can serve as a helper here, as it accepts custom deleters. Unfortunately, the interface is not ergonomic, which we can fix by introducing a short helper.

Compiler Explorer link: compiler-explorer.com/z/Gvr7ec