carta
freebsd::nvlist_up(3)

freebsd::nvlist_up3

Std::unique_ptr specialization for name/value pairs

Usage

using nvlist_up = std::unique_ptr<nvlist, nvlist_deleter>;

Library

library “libutil++”

Overview

This class is a specialization of std::unique_ptr for nvlist_t objects. When an nvlist_t object managed by an instance of this class is disposed, nvlist_destroy(3) is invoked to dispose of the object.

Examples

freebsd::nvlist_up nvl(nvlist_create(0));
nvlist_add_number(nvl.get(), "answer", 42);
nvlist_add_bool(nvl.get(), "valid", true);
// `nvl' is implicitly destroyed

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.