FREEBSD::NVLIST_UP(3)

πŸ“¦ version 15.1, in freebsd 15.1

πŸ’– 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms