fmt::to_string

to_string overloads

Synopses

Declared in <fmt/format.h>

Converts value to std::string using the default format for type T.

template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T value);
» more...

Converts value to std::string using the default format for the type returned by format_as(value).

template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T const& value);
» more...

Converts value to std::string using the default format for type T.

template<typename T>
[[nodiscard]]
constexpr
std::string
to_string(T const& value);
» more...

Converts the contents of buf to a std::string.

template<size_t SIZE>
[[nodiscard]]
std::string
to_string(basic_memory_buffer<char, SIZE> const& buf);
» more...

Return Value

  • The default string representation of value.
  • The default string representation of format_as(value).
  • A std::string containing a copy of the buffer's contents.

NOTE

The return value should not be discarded.

Parameters

NameDescription
valueThe integral value to convert.
bufThe buffer to convert.