6#if !defined(__XTD_CORE_INTERNAL__)
7#error "Do not include this file: Internal use only"
17#if (defined(__cpp_lib_format) && defined(_MSC_VER) && _MSC_VER >= 1932) || (defined(__apple_build_version__) && __apple_build_version__ >= 15000300) || (!defined(__APPLE__) && defined(__GNUC__) && __GNUC__ >= 13) || (!defined(__APPLE__) && defined(__clang_major__) && __clang_major__ >= 15)
19template <
class type_t>
20requires (std::derived_from<xtd::raw_type<type_t>,
xtd::object> ||
25 std::derived_from<xtd::raw_type<type_t>, std::exception> ||
26 std::is_enum_v<xtd::raw_type<type_t>>
28struct std::formatter<type_t> : std::formatter<std::
string> {
29 template<
typename format_context_t>
30 constexpr auto parse(format_context_t& ctx) {
33 format_value += *iterator;
37 template<
typename object_t,
typename format_context_t>
39 constexpr auto format(
const object_t& obj, format_context_t& ctx)
const {
40 return std::format_to(ctx.out(),
"{}", obj.to_string(format_value).c_str());
43 template<
typename object_t,
typename format_context_t>
45 constexpr auto format(
const object_t& obj, format_context_t& ctx)
const {
46 return std::format_to(ctx.out(),
"{}", obj.to_string().c_str());
50 std::string format_value;
Provides a way to represent the current object as a string.
Definition istringable.hpp:26
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
Definition textual.hpp:16
@ value
Represnets the constant operator precedence (42).
Definition operator_precedence.hpp:30
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
std::remove_cvref_t< value_t > raw_type
Represents a raw type alias equivalent to std::remove_cvref_t<value_t>.
Definition raw_type.hpp:25
auto parse(const std::string &str) -> value_t
Convert a string into a type.
Definition parse.hpp:34
const xtd::collections::generic::helpers::wrap_pointer_iterator< pointer > iterator
Represents the iterator of read_only_span value type.
Definition read_only_span.hpp:70
Contains xtd::raw_type alias.
Contains xtd::string alias.
Contains xtd::textual concept.