std::visit_format_arg(3)

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

✨ NAME ✨

std::visit_format_arg β€” bestie, it's literally std::visit_format_arg. This is the page for std::visit_format_arg(3) in the C++ Standard Libary manual, and we are going to get through it together 🫢.

🌸 SYNOPSIS 🌸

Okay so the synopsis is giving header, template, deprecation realness. Here it is, exactly:

Defined in header <format>
template< class Visitor, class Context >                       (since
C++20)
/* see below */ visit_format_arg( Visitor&& vis,
(deprecated in C++26)
std::basic_format_arg<Context> arg );

It applies the visitor vis to the object contained in arg. Periodt.

Equivalent to std::visit(std::forward<Visitor>(vis), value), where value is the std::variant stored in arg.

πŸŽ€ PARAMETERS πŸŽ€

  • vis β€” a Callable that accepts every possible alternative from arg. Every. Single. One. No skipping, bestie πŸ’….
  • arg β€” a std::basic_format_arg to be visited.

πŸ’– RETURN VALUE πŸ’–

The value returned by the selected invocation of the visitor. That's the whole answer, and it ate ✨.

πŸ“ NOTES πŸ“

As of C++26, std::visit_format_arg is deprecated in favor of the visit member functions of std::basic_format_arg.

Deprecated means "please stop using this, bestie." It's not a warning to ignore β€” it's the library telling you the member functions are the main character now πŸ‘‘.

πŸ§ͺ EXAMPLE πŸ§ͺ

This section is incomplete Reason: no example

πŸ‘€ SEE ALSO πŸ‘€

  • make_format_args β€” creates a type-erased object referencing all formatting arguments, convertible to format_args β€” (C++20) β€” (function template)
  • make_wformat_args β€” (C++20)

🏷️ CATEGORY 🏷️

  • Todo no example

source/version and date, for the record: http://cppreference.com Β· 2024.06.10 β€” bye bestie, go visit some format args for me πŸ«ΆπŸ’‹

πŸ“¦ where this page comes from