std::va_list(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

✨ NAME ✨

std::va_list - std::va_list β€” bestie, welcome to std::va_list(3), a page straight from the C++ Standard Libary, and it is literally about std::va_list πŸ’…


πŸ’– Synopsis πŸ’–

Defined in header <cstdarg>
typedef /* unspecified */ va_list;

va_list is a complete object type (in practice, a unique built-in type or char*) suitable for holding the information needed by the macros va_start, va_copy, va_arg, and va_end ✨

If a va_list instance is created, passed to another function, and used via va_arg in that function, then any subsequent use in the calling function should be preceded by a call to va_end. That part is important, okay? 🫢

It is legal to pass a pointer to a va_list object to another function and then use that object after the function returns. No cap, that's the rule 🌸


πŸ‘€ See also πŸ‘€

  • va_start β€” enables access to variadic function arguments (function macro) ⭐
  • va_copy β€” makes a copy of the variadic function arguments (C++11) (function macro) πŸŽ€
  • va_arg β€” accesses the next variadic function argument (function macro) πŸ”₯
  • va_end β€” ends traversal of the variadic function arguments (function macro) πŸ’œ
  • C documentation for va_list πŸ“š

That's the whole vibe, bestie: source/version cppreference.com, date 2024.06.10, page std::va_list(3). Bye and slay your variadic functions responsibly πŸ’–πŸ¦‹πŸ’…

πŸ“¦ where this page comes from