Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
core.h File Reference
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <string>
#include <type_traits>

Go to the source code of this file.

Classes

struct  internal::result_of< typename >
 
struct  internal::result_of< F(Args...)>
 
class  internal::basic_buffer< T >
 
class  internal::container_buffer< Container >
 
struct  internal::error_handler
 
struct  internal::no_formatter_error< T >
 
struct  is_constructible< T >
 
class  basic_string_view< Char >
 
struct  compile_string
 
struct  is_compile_string< S >
 
class  basic_format_arg< Context >
 
class  basic_format_args< Context >
 
struct  formatter< T, Char, Enable >
 
struct  convert_to_int< T, Char, Enable >
 
struct  internal::dummy_string_view
 
struct  internal::is_string< S >
 
struct  internal::char_t< S >
 
struct  internal::named_arg_base< Char >
 
struct  internal::named_arg< T, Char >
 
struct  internal::string_value< Char >
 
struct  internal::custom_value< Context >
 
class  internal::value< Context >
 
struct  internal::init< Context, T, TYPE >
 
class  internal::arg_map< Context >
 
class  basic_format_arg< Context >
 
class  basic_format_arg< Context >::handle
 
struct  monostate
 
class  basic_parse_context< Char, ErrorHandler >
 
class  internal::arg_map< Context >
 
struct  internal::arg_map< Context >::entry
 
class  internal::locale_ref
 
class  internal::context_base< OutputIt, Context, Char >
 
struct  internal::get_type< Context, T >
 
class  basic_format_context< OutputIt, Char >
 
struct  basic_format_context< OutputIt, Char >::formatter_type< T >
 
struct  buffer_context< Char >
 
class  format_arg_store< Context, Args >
 
class  basic_format_args< Context >
 
struct  format_args
 
struct  wformat_args
 
struct  char_t< S >
 
struct  internal::named_arg_base< Char >
 
struct  internal::named_arg< T, Char >
 
struct  internal::checked_args< S, Args >
 
struct  is_contiguous< Container >
 
struct  is_contiguous< std::basic_string< Char > >
 
struct  is_contiguous< internal::basic_buffer< Char > >
 

Namespaces

 internal
 

Macros

#define FMT_VERSION   50300
 
#define FMT_HAS_FEATURE(x)   0
 
#define FMT_HAS_INCLUDE(x)   0
 
#define FMT_HAS_CPP_ATTRIBUTE(x)   0
 
#define FMT_GCC_VERSION   0
 
#define FMT_HAS_GXX_CXX11   0
 
#define FMT_MSC_VER   0
 
#define FMT_USE_CONSTEXPR
 
#define FMT_CONSTEXPR   inline
 
#define FMT_CONSTEXPR_DECL
 
#define FMT_USE_CONSTEXPR11   (FMT_USE_CONSTEXPR || FMT_GCC_VERSION >= 406 || FMT_MSC_VER >= 1900)
 
#define FMT_CONSTEXPR11
 
#define FMT_OVERRIDE
 
#define FMT_USE_EXPLICIT   0
 
#define FMT_EXPLICIT
 
#define FMT_NULL   NULL
 
#define FMT_USE_NULLPTR   0
 
#define FMT_EXCEPTIONS   1
 
#define FMT_USE_NOEXCEPT   0
 
#define FMT_DETECTED_NOEXCEPT   throw()
 
#define FMT_HAS_CXX11_NOEXCEPT   0
 
#define FMT_NOEXCEPT   FMT_DETECTED_NOEXCEPT
 
#define FMT_INLINE_NAMESPACE   namespace
 
#define FMT_END_NAMESPACE   } using namespace v5; }
 
#define FMT_BEGIN_NAMESPACE   namespace fmt { FMT_INLINE_NAMESPACE v5 {
 
#define FMT_API
 
#define FMT_ASSERT(condition, message)   assert((condition) && message)
 
#define FMT_MAKE_VALUE(TAG, ArgType, ValueType)
 
#define FMT_MAKE_VALUE_SAME(TAG, Type)
 
#define FMT_ENABLE_IF_T(B, T)   typename std::enable_if<B, T>::type
 
#define FMT_USE_ALIAS_TEMPLATES   FMT_HAS_FEATURE(cxx_alias_templates)
 
#define FMT_CHAR(S)   typename char_t<S>::type
 

Typedefs

typedef basic_buffer< char > internal::buffer
 
typedef basic_buffer< wchar_t > internal::wbuffer
 
typedef basic_string_view< char > string_view
 
typedef basic_string_view< wchar_t > wstring_view
 
typedef std::conditional< sizeof(long)==sizeof(int), int, long long >::type internal::long_type
 
typedef basic_parse_context< char > format_parse_context
 
typedef basic_parse_context< wchar_t > wformat_parse_context
 
typedef basic_parse_context< char > parse_context
 
typedef basic_parse_context< wchar_t > wparse_context
 
typedef buffer_context< char >::type format_context
 
typedef buffer_context< wchar_t >::type wformat_context
 

Enumerations

enum  internal::type {
  internal::none_type, internal::named_arg_type, internal::int_type, internal::uint_type,
  internal::long_long_type, internal::ulong_long_type, internal::bool_type, internal::char_type,
  internal::last_integer_type = char_type, internal::double_type, internal::long_double_type, internal::last_numeric_type = long_double_type,
  internal::cstring_type, internal::string_type, internal::pointer_type, internal::custom_type
}
 
enum  { internal::max_packed_args = 15 }
 
enum  : unsigned long long { internal::is_unpacked_bit = 1ull << 63 }
 

Functions

template<typename T >
std::add_rvalue_reference< T >::type internal::declval () FMT_NOEXCEPT
 
template<typename Int >
FMT_CONSTEXPR std::make_unsigned< Int >::type internal::to_unsigned (Int value)
 
template<typename Container >
Container & internal::get_container (std::back_insert_iterator< Container > it)
 
template<typename Char >
basic_string_view< Char > to_string_view (basic_string_view< Char > s)
 
template<typename Char >
basic_string_view< Char > to_string_view (const std::basic_string< Char > &s)
 
template<typename Char >
basic_string_view< Char > to_string_view (const Char *s)
 
template<typename S , typename Enable = typename std::enable_if<is_compile_string<S>::value>::type>
FMT_CONSTEXPR basic_string_view< typename S::char_type > to_string_view (const S &s)
 
dummy_string_view internal::to_string_view (...)
 
FMT_CONSTEXPR bool internal::is_integral (type t)
 
FMT_CONSTEXPR bool internal::is_arithmetic (type t)
 
template<typename Context , typename T >
FMT_CONSTEXPR basic_format_arg< Context > internal::make_arg (const T &value)
 
FMT_MAKE_VALUE((sizeof(long)==sizeof(int)?int_type:long_long_type), long, long_type) typedef std internal::FMT_MAKE_VALUE ((sizeof(unsigned long)==sizeof(unsigned)?uint_type:ulong_long_type), unsigned long, ulong_type) template< typename C
 
FMT_MAKE_VALUE((sizeof(long)==sizeof(int)?int_type:long_long_type), long, long_type) typedef std Char FMT_CONSTEXPR std::enable_if< std::is_same< typename C::char_type, Char >::value, init< C, int, char_type > >::type internal::make_value (Char val)
 
template<typename C >
FMT_CONSTEXPR std::enable_if< !std::is_same< typename C::char_type, char >::value, init< C, int, char_type > >::type internal::make_value (char val)
 
 internal::FMT_MAKE_VALUE (cstring_type, typename C::char_type *, const typename C::char_type *) FMT_MAKE_VALUE(cstring_type
 
const C::char_type const C::char_type * internal::FMT_MAKE_VALUE (string_type, typename basic_string_view< typename C::char_type >::type, basic_string_view< typename C::char_type >) FMT_MAKE_VALUE(string_type
 
template<typename C , typename T >
const C::char_type const C::char_type const std::basic_string< typename C::char_type > basic_string_view< typename C::char_type > std::enable_if<!std::is_same< T, typename C::char_type >::value >::type internal::make_value (const T *)
 
template<typename C , typename T >
std::enable_if< std::is_enum< T >::value &&convert_to_int< T, typename C::char_type >::value, init< C, int, int_type > >::type internal::make_value (const T &val)
 
template<typename C , typename T , typename Char = typename C::char_type>
std::enable_if< is_constructible< basic_string_view< Char >, T >::value &&!internal::is_string< T >::value, init< C, basic_string_view< Char >, string_type > >::type internal::make_value (const T &val)
 
template<typename C , typename T , typename Char = typename C::char_type>
std::enable_if< !convert_to_int< T, Char >::value &&!std::is_same< T, Char >::value &&!std::is_convertible< T, basic_string_view< Char > >::value &&!is_constructible< basic_string_view< Char >, T >::value &&!internal::is_string< T >::value, init< C, const T &, custom_type > >::type internal::make_value (const T &val)
 
template<typename C , typename T >
init< C, const void *, named_arg_type > internal::make_value (const named_arg< T, typename C::char_type > &val)
 
template<typename C , typename S >
FMT_CONSTEXPR11 std::enable_if< internal::is_string< S >::value, init< C, basic_string_view< typename C::char_type >, string_type > >::type internal::make_value (const S &val)
 
template<typename Visitor , typename Context >
FMT_CONSTEXPR internal::result_of< Visitor(int)>::type visit_format_arg (Visitor &&vis, const basic_format_arg< Context > &arg)
 
template<typename Visitor , typename Context >
FMT_CONSTEXPR internal::result_of< Visitor(int)>::type visit (Visitor &&vis, const basic_format_arg< Context > &arg)
 
template<typename Context >
FMT_CONSTEXPR11 unsigned long long internal::get_types ()
 
template<typename Context , typename Arg , typename... Args>
FMT_CONSTEXPR11 unsigned long long internal::get_types ()
 
template<bool IS_PACKED, typename Context , typename T >
std::enable_if< IS_PACKED, value< Context > >::type internal::make_arg (const T &value)
 
template<bool IS_PACKED, typename Context , typename T >
std::enable_if<!IS_PACKED, basic_format_arg< Context > >::type internal::make_arg (const T &value)
 
template<typename Context = format_context, typename... Args>
format_arg_store< Context, Args... > make_format_args (const Args &...args)
 
template<typename... Args, typename S >
std::enable_if<!is_compile_string< S >::value >::type internal::check_format_string (const S &)
 
template<typename... Args, typename S >
std::enable_if< is_compile_string< S >::value >::type internal::check_format_string (S)
 
template<typename Char >
std::basic_string< Char > internal::vformat (basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
 
template<typename Char >
buffer_context< Char >::type::iterator internal::vformat_to (internal::basic_buffer< Char > &buf, basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
 
template<typename T >
internal::named_arg< T, char > arg (string_view name, const T &arg)
 
template<typename T >
internal::named_arg< T, wchar_t > arg (wstring_view name, const T &arg)
 
template<typename S , typename T , typename Char >
void arg (S, internal::named_arg< T, Char >)=delete
 
template<typename Container , typename S >
std::enable_if< is_contiguous< Container >::value, std::back_insert_iterator< Container > >::type vformat_to (std::back_insert_iterator< Container > out, const S &format_str, basic_format_args< typename buffer_context< FMT_CHAR(S)>::type > args)
 
template<typename Container , typename S , typename... Args>
std::enable_if< is_contiguous< Container >::value &&internal::is_string< S >::value, std::back_insert_iterator< Container > >::type format_to (std::back_insert_iterator< Container > out, const S &format_str, const Args &...args)
 
template<typename S , typename Char = FMT_CHAR(S)>
std::basic_string< Char > vformat (const S &format_str, basic_format_args< typename buffer_context< Char >::type > args)
 
template<typename S , typename... Args>
std::basic_string< FMT_CHAR(S)> format (const S &format_str, const Args &...args)
 
FMT_API void vprint (std::FILE *f, string_view format_str, format_args args)
 
FMT_API void vprint (std::FILE *f, wstring_view format_str, wformat_args args)
 
template<typename S , typename... Args>
 FMT_ENABLE_IF_T (internal::is_string< S >::value, void) print(std
 
FMT_API void vprint (string_view format_str, format_args args)
 
FMT_API void vprint (wstring_view format_str, wformat_args args)
 

Variables

const Args & args
 

Macro Definition Documentation

#define FMT_API

Definition at line 166 of file core.h.

#define FMT_ASSERT (   condition,
  message 
)    assert((condition) && message)

Definition at line 170 of file core.h.

#define FMT_BEGIN_NAMESPACE   namespace fmt { FMT_INLINE_NAMESPACE v5 {

Definition at line 155 of file core.h.

#define FMT_CHAR (   S)    typename char_t<S>::type

Definition at line 1320 of file core.h.

#define FMT_CONSTEXPR   inline

Definition at line 69 of file core.h.

#define FMT_CONSTEXPR11

Definition at line 80 of file core.h.

#define FMT_CONSTEXPR_DECL

Definition at line 70 of file core.h.

#define FMT_DETECTED_NOEXCEPT   throw()

Definition at line 134 of file core.h.

#define FMT_ENABLE_IF_T (   B,
 
)    typename std::enable_if<B, T>::type

Definition at line 1305 of file core.h.

#define FMT_END_NAMESPACE   } using namespace v5; }

Definition at line 153 of file core.h.

#define FMT_EXCEPTIONS   1

Definition at line 120 of file core.h.

#define FMT_EXPLICIT

Definition at line 98 of file core.h.

#define FMT_GCC_VERSION   0

Definition at line 43 of file core.h.

#define FMT_HAS_CPP_ATTRIBUTE (   x)    0

Definition at line 37 of file core.h.

#define FMT_HAS_CXX11_NOEXCEPT   0

Definition at line 135 of file core.h.

#define FMT_HAS_FEATURE (   x)    0

Definition at line 24 of file core.h.

#define FMT_HAS_GXX_CXX11   0

Definition at line 49 of file core.h.

#define FMT_HAS_INCLUDE (   x)    0

Definition at line 31 of file core.h.

#define FMT_INLINE_NAMESPACE   namespace

Definition at line 152 of file core.h.

#define FMT_MAKE_VALUE (   TAG,
  ArgType,
  ValueType 
)
Value:
template <typename C> \
FMT_CONSTEXPR init<C, ValueType, TAG> make_value(ArgType val) { \
return static_cast<ValueType>(val); \
}
FMT_CONSTEXPR11 std::enable_if< internal::is_string< S >::value, init< C, basic_string_view< typename C::char_type >, string_type > >::type make_value(const S &val)
Definition: core.h:760

Definition at line 642 of file core.h.

#define FMT_MAKE_VALUE_SAME (   TAG,
  Type 
)
Value:
template <typename C> \
FMT_CONSTEXPR init<C, Type, TAG> make_value(Type val) { return val; }
FMT_CONSTEXPR11 std::enable_if< internal::is_string< S >::value, init< C, basic_string_view< typename C::char_type >, string_type > >::type make_value(const S &val)
Definition: core.h:760
Type
Type of JSON value.
Definition: rapidjson.h:618

Definition at line 648 of file core.h.

#define FMT_MSC_VER   0

Definition at line 55 of file core.h.

#define FMT_NOEXCEPT   FMT_DETECTED_NOEXCEPT

Definition at line 140 of file core.h.

#define FMT_NULL   NULL

Definition at line 107 of file core.h.

#define FMT_OVERRIDE

Definition at line 88 of file core.h.

#define FMT_USE_ALIAS_TEMPLATES   FMT_HAS_FEATURE(cxx_alias_templates)

Definition at line 1308 of file core.h.

#define FMT_USE_CONSTEXPR
Value:
(FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1910 || \
(FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L))
#define FMT_MSC_VER
Definition: core.h:55
#define FMT_GCC_VERSION
Definition: core.h:43
#define FMT_HAS_FEATURE(x)
Definition: core.h:24

Definition at line 61 of file core.h.

#define FMT_USE_CONSTEXPR11   (FMT_USE_CONSTEXPR || FMT_GCC_VERSION >= 406 || FMT_MSC_VER >= 1900)

Definition at line 74 of file core.h.

#define FMT_USE_EXPLICIT   0

Definition at line 97 of file core.h.

#define FMT_USE_NOEXCEPT   0

Definition at line 126 of file core.h.

#define FMT_USE_NULLPTR   0

Definition at line 111 of file core.h.

#define FMT_VERSION   50300

Definition at line 19 of file core.h.

Typedef Documentation

Definition at line 1129 of file core.h.

Definition at line 925 of file core.h.

Definition at line 929 of file core.h.

Definition at line 428 of file core.h.

typedef buffer_context<wchar_t>::type wformat_context

Definition at line 1130 of file core.h.

Definition at line 926 of file core.h.

Definition at line 930 of file core.h.

typedef basic_string_view<wchar_t> wstring_view

Definition at line 429 of file core.h.

Function Documentation

template<typename T >
internal::named_arg<T, char> arg ( string_view  name,
const T &  arg 
)
inline

Returns a named argument to be used in a formatting function.

Example**::

fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23));

Definition at line 1391 of file core.h.

1391  {
1392  return {name, arg};
1393 }
static QCString name
Definition: declinfo.cpp:673
internal::named_arg< T, char > arg(string_view name, const T &arg)
Definition: core.h:1391
template<typename T >
internal::named_arg<T, wchar_t> arg ( wstring_view  name,
const T &  arg 
)
inline

Definition at line 1396 of file core.h.

1396  {
1397  return {name, arg};
1398 }
static QCString name
Definition: declinfo.cpp:673
internal::named_arg< T, char > arg(string_view name, const T &arg)
Definition: core.h:1391
template<typename S , typename T , typename Char >
void arg ( S  ,
internal::named_arg< T, Char >   
)
delete
template<typename S , typename... Args>
FMT_ENABLE_IF_T ( internal::is_string< S >::value  ,
void   
)
inline

Prints formatted data to the file f. For wide format strings, f* should be in wide-oriented mode set via fwide(f, 1) or _setmode(_fileno(f), _O_U8TEXT) on Windows.

Example**::

fmt::print(stderr, "Don't {}!", "panic");

Prints formatted data to stdout.

Example**::

fmt::print("Elapsed time: {0:.2f} seconds", 1.23);

Definition at line 1476 of file core.h.

1477  {
1480 }
const S & format_str
Definition: format.h:3342
FMT_API void vprint(std::FILE *f, string_view format_str, format_args args)
Definition: format-inl.h:945
basic_string_view< Char > to_string_view(basic_string_view< Char > s)
Definition: core.h:455
const Args & args
Definition: core.h:1496
template<typename S , typename... Args>
std::basic_string<FMT_CHAR(S)> format ( const S format_str,
const Args &...  args 
)
inline

Formats arguments and returns the result as a string.

Example**::

#include <fmt/core.h> std::string message = fmt::format("The answer is {}", 42);

Definition at line 1454 of file core.h.

1455  {
1456  return internal::vformat(
1457  to_string_view(format_str),
1458  *internal::checked_args<S, Args...>(format_str, args...));
1459 }
std::basic_string< Char > vformat(basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
Definition: format.h:3410
basic_string_view< Char > to_string_view(basic_string_view< Char > s)
Definition: core.h:455
const Args & args
Definition: core.h:1496
template<typename Container , typename S , typename... Args>
std::enable_if< is_contiguous<Container>::value && internal::is_string<S>::value, std::back_insert_iterator<Container> >::type format_to ( std::back_insert_iterator< Container >  out,
const S format_str,
const Args &...  args 
)
inline

Definition at line 1430 of file core.h.

1431  {
1432  internal::checked_args<S, Args...> ca(format_str, args...);
1433  return vformat_to(out, to_string_view(format_str), *ca);
1434 }
std::enable_if< is_contiguous< Container >::value, std::back_insert_iterator< Container > >::type vformat_to(std::back_insert_iterator< Container > out, const S &format_str, basic_format_args< typename buffer_context< FMT_CHAR(S)>::type > args)
Definition: core.h:1417
basic_string_view< Char > to_string_view(basic_string_view< Char > s)
Definition: core.h:455
const Args & args
Definition: core.h:1496
template<typename Context = format_context, typename... Args>
format_arg_store<Context, Args...> make_format_args ( const Args &...  args)
inline

Constructs an ~fmtformat_arg_store object that contains references to arguments and can be implicitly converted to ~fmtformat_args. Context can be omitted in which case it defaults to ~fmtcontext.

Definition at line 1199 of file core.h.

1199 { return {args...}; }
const Args & args
Definition: core.h:1496
template<typename Char >
basic_string_view<Char> to_string_view ( basic_string_view< Char >  s)
inline

The function to_string_view adapts non-intrusively any kind of string or string-like type if the user provides a (possibly templated) overload of to_string_view which takes an instance of the string class StringType<Char> and returns a fmt::basic_string_view<Char>. The conversion function must live in the very same namespace as StringType<Char> to be picked up by ADL. Non-templated string types like f.e. QString must return a basic_string_view with a fixed matching char type.

Example**::

namespace my_ns { inline string_view to_string_view(const my_string &s) { return {s.data(), s.length()}; } }

std::string message = fmt::format(my_string("The answer is {}"), 42);

Definition at line 455 of file core.h.

455 { return s; }
static QCString * s
Definition: config.cpp:1042
template<typename Char >
basic_string_view<Char> to_string_view ( const std::basic_string< Char > &  s)
inline

Definition at line 459 of file core.h.

459 { return s; }
static QCString * s
Definition: config.cpp:1042
template<typename Char >
basic_string_view<Char> to_string_view ( const Char *  s)
inline

Definition at line 462 of file core.h.

462 { return s; }
static QCString * s
Definition: config.cpp:1042
template<typename S , typename Enable = typename std::enable_if<is_compile_string<S>::value>::type>
FMT_CONSTEXPR basic_string_view<typename S::char_type> to_string_view ( const S s)

Definition at line 481 of file core.h.

481 { return s; }
static QCString * s
Definition: config.cpp:1042
template<typename S , typename Char = FMT_CHAR(S)>
std::basic_string<Char> vformat ( const S format_str,
basic_format_args< typename buffer_context< Char >::type args 
)
inline

Definition at line 1437 of file core.h.

1439  {
1440  return internal::vformat(to_string_view(format_str), args);
1441 }
std::basic_string< Char > vformat(basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
Definition: format.h:3410
basic_string_view< Char > to_string_view(basic_string_view< Char > s)
Definition: core.h:455
template<typename Container , typename S >
std::enable_if< is_contiguous<Container>::value, std::back_insert_iterator<Container> >::type vformat_to ( std::back_insert_iterator< Container >  out,
const S format_str,
basic_format_args< typename buffer_context< FMT_CHAR(S)>::type args 
)

Formats a string and writes the output to out.

Definition at line 1417 of file core.h.

1420  {
1422  internal::vformat_to(buf, to_string_view(format_str), args);
1423  return out;
1424 }
Container & get_container(std::back_insert_iterator< Container > it)
Definition: core.h:313
buffer_context< Char >::type::iterator vformat_to(internal::basic_buffer< Char > &buf, basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
Definition: format.h:3233
basic_string_view< Char > to_string_view(basic_string_view< Char > s)
Definition: core.h:455
template<typename Visitor , typename Context >
FMT_CONSTEXPR internal::result_of<Visitor(int)>::type visit ( Visitor &&  vis,
const basic_format_arg< Context > &  arg 
)

Definition at line 871 of file core.h.

871  {
872  return visit_format_arg(std::forward<Visitor>(vis), arg);
873 }
FMT_CONSTEXPR internal::result_of< Visitor(int)>::type visit_format_arg(Visitor &&vis, const basic_format_arg< Context > &arg)
Definition: core.h:831
template<typename Visitor , typename Context >
FMT_CONSTEXPR internal::result_of<Visitor(int)>::type visit_format_arg ( Visitor &&  vis,
const basic_format_arg< Context > &  arg 
)

Visits an argument dispatching to the appropriate visit method based on the argument type. For example, if the argument type is double then vis(value) will be called with the value of type double.

Definition at line 831 of file core.h.

831  {
832  typedef typename Context::char_type char_type;
833  switch (arg.type_) {
834  case internal::none_type:
835  break;
837  FMT_ASSERT(false, "invalid argument type");
838  break;
839  case internal::int_type:
840  return vis(arg.value_.int_value);
841  case internal::uint_type:
842  return vis(arg.value_.uint_value);
844  return vis(arg.value_.long_long_value);
846  return vis(arg.value_.ulong_long_value);
847  case internal::bool_type:
848  return vis(arg.value_.int_value != 0);
849  case internal::char_type:
850  return vis(static_cast<char_type>(arg.value_.int_value));
852  return vis(arg.value_.double_value);
854  return vis(arg.value_.long_double_value);
856  return vis(arg.value_.string.value);
858  return vis(basic_string_view<char_type>(
859  arg.value_.string.value, arg.value_.string.size));
861  return vis(arg.value_.pointer);
863  return vis(typename basic_format_arg<Context>::handle(arg.value_.custom));
864  }
865  return vis(monostate());
866 }
internal::value< Context > value_
Definition: core.h:781
#define FMT_ASSERT(condition, message)
Definition: core.h:170
internal::type type_
Definition: core.h:782
FMT_API void vprint ( std::FILE *  f,
string_view  format_str,
format_args  args 
)

Definition at line 945 of file format-inl.h.

945  {
947  internal::vformat_to(buffer, format_str,
949  std::fwrite(buffer.data(), 1, buffer.size(), f);
950 }
T * data() FMT_NOEXCEPT
Definition: core.h:256
buffer_context< Char >::type::iterator vformat_to(internal::basic_buffer< Char > &buf, basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
Definition: format.h:3233
internal::basic_buffer< FMT_CHAR(S)> buffer
Definition: printf.h:757
std::size_t size() const FMT_NOEXCEPT
Definition: core.h:250
FMT_API void vprint ( std::FILE *  f,
wstring_view  format_str,
wformat_args  args 
)

Definition at line 952 of file format-inl.h.

952  {
954  internal::vformat_to(buffer, format_str, args);
955  std::fwrite(buffer.data(), sizeof(wchar_t), buffer.size(), f);
956 }
T * data() FMT_NOEXCEPT
Definition: core.h:256
buffer_context< Char >::type::iterator vformat_to(internal::basic_buffer< Char > &buf, basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
Definition: format.h:3233
internal::basic_buffer< FMT_CHAR(S)> buffer
Definition: printf.h:757
std::size_t size() const FMT_NOEXCEPT
Definition: core.h:250
FMT_API void vprint ( string_view  format_str,
format_args  args 
)

Definition at line 958 of file format-inl.h.

958  {
959  vprint(stdout, format_str, args);
960 }
FMT_FUNC void vprint(std::FILE *f, string_view format_str, format_args args)
Definition: format-inl.h:945
FMT_API void vprint ( wstring_view  format_str,
wformat_args  args 
)

Definition at line 962 of file format-inl.h.

962  {
963  vprint(stdout, format_str, args);
964 }
FMT_FUNC void vprint(std::FILE *f, string_view format_str, format_args args)
Definition: format-inl.h:945

Variable Documentation

const Args & args
Initial value:
{
const S & format_str
Definition: format.h:3342
FMT_API void vprint(std::FILE *f, string_view format_str, format_args args)
Definition: format-inl.h:945
basic_string_view< Char > to_string_view(basic_string_view< Char > s)
Definition: core.h:455
const Args & args
Definition: core.h:1496

Definition at line 1496 of file core.h.