1.\" 2.\" SPDX-License-Identifier: BSD-2-Clause 3.\" 4.\" Copyright (c) 2025 Chelsio Communications, Inc. 5.\" Written by: John Baldwin <jhb@FreeBSD.org> 6.\" 7.Dd July 31, 2025 8.Dt FREEBSD::NVLIST_UP 3 9.Os 10.Sh NAME 11.Nm freebsd::nvlist_up 12.Nd std::unique_ptr specialization for name/value pairs 13.Sh LIBRARY 14.Lb libutil++ 15.Sh SYNOPSIS 16.In libutil++.hh 17.Ft using nvlist_up = std::unique_ptr<nvlist, nvlist_deleter>; 18.Sh DESCRIPTION 19This class is a specialization of 20.Vt std::unique_ptr 21for 22.Vt nvlist_t 23objects. 24When an 25.Vt nvlist_t 26object managed by an instance of this class is disposed, 27.Xr nvlist_destroy 3 28is invoked to dispose of the object. 29.Sh EXAMPLES 30.Bd -literal -offset indent 31freebsd::nvlist_up nvl(nvlist_create(0)); 32nvlist_add_number(nvl.get(), "answer", 42); 33nvlist_add_bool(nvl.get(), "valid", true); 34// `nvl' is implicitly destroyed 35.Ed 36.Sh SEE ALSO 37.Xr nvlist_destroy 3 38