Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::visit_format_arg

      From cppreference.com
      <cpp‎ |utility‎ |format
       
       
       
      Formatting library
      Standard format specification
      Formatting functions
      (C++20)
      (C++20)
      (C++20)
      (C++20)
      Format strings
      Formatting concepts
      Formatter
      (C++20)
      Formatting arguments
      visit_format_arg
      (C++20)(deprecated in C++26)
      Format error
       
      Defined in header<format>
      template<class Visitor,class Context>
      /* see below */ visit_format_arg( Visitor&& vis,std::basic_format_arg<Context> arg);
      (since C++20)
      (deprecated in C++26)

      Applies the visitorvis to the object contained inarg.

      Equivalent tostd::visit(std::forward<Visitor>(vis), value), wherevalue is thestd::variant stored inarg.

      Contents

      [edit]Parameters

      vis - aCallable that accepts every possible alternative fromarg
      arg - astd::basic_format_arg to be visited

      [edit]Return value

      The value returned by the selected invocation of the visitor.

      [edit]Notes

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

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      creates a type-erased object referencing all formatting arguments, convertible toformat_args
      (function template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/format/visit_format_arg&oldid=163586"

      [8]ページ先頭

      ©2009-2025 Movatter.jp