FREEBSD::NVLIST_UP(3)
π FREEBSD::NVLIST_UP(3) π
okay so bestie, welcome to the FREEBSD::NVLIST_UP(3) page β a whole manual section for one tiny little std::unique_ptr glow-up, and honestly? she's serving convenience π
β¨ NAME β¨
freebsd::nvlist_up β a std::unique_ptr specialization for name/value pairs. that's the whole vibe, no cap.
π LIBRARY π
library βlibutil++β β that's where she lives π«Ά
π¦ SYNOPSIS π¦
#include <libutil++.hh>
using nvlist_up = std::unique_ptr<nvlist, nvlist_deleter>;
literally that's it. that's the whole incantation β¨
πΈ DESCRIPTION πΈ
so here's the tea, bestie: this class is a specialization of std::unique_ptr for nvlist_t objects. icon behaviour only π
and when an nvlist_t object managed by an instance of this class is disposed, nvlist_destroy(3) gets invoked to dispose of the object. automatic cleanup, no manual teardown, no leaking, we simply do not do that here π
it's giving main character energy with a deleter. iykyk.
π₯ 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
look at her go π₯Ή create it, add a number, add a bool, then just let go and the destructor handles the rest. the comment says it all: // nvl' is implicitly destroyedβ no manualnvlist_destroy` call in sight. obsessed.
π§ SEE ALSO π§
nvlist_destroy(3)β the one doing the actual cleanup work behind the scenes, so show her some respect fr fr π
π reminder bestie: the magic here is the deleter. you don't call destroy yourself β the unique_ptr does it for you, on purpose, by design. that's not a bug, that's the entire point β
and that's the page!! π this cutie was brought to you by the Debian gang, dated July 31, 2025, and stamped FREEBSD::NVLIST_UP(3) top and bottom like a little matching set π bye bestie, go manage some name/value pairs responsibly π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π the page's license: BSD-2-Clause
- Copyright (c) 2025 Chelsio Communications, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms