Namespaces
Variants
Views
Actions

std::range-default-formatter<std::range_format::set>

From cppreference.com
 
 
Utilities library
Language support
Type support (basic types, RTTI)
Library feature-test macros (C++20)
Dynamic memory management
Program utilities
Coroutine support (C++20)
Variadic functions
Debugging support
(C++26)
Three-way comparison
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)

 
 
 
Defined in header <format>
template< ranges::input_range R, class CharT >
struct range-default-formatter<range_format::set, R, CharT>;
(since C++23)
(exposition only*)

The class template range-default-formatter for range types is specialized for formatting range as a set of keys if std::format_kind<R> is std::range_format::set.

Contents

[edit] Member types

Member type Definition
maybe-const-set (private) /*fmt-maybe-const*/<R, CharT>
(exposition-only member type*)

[edit] Member objects

Member name Definition
underlying_ (private) the underlying formatter of type std::range_formatter<std::remove_cvref_t<ranges::range_reference_t<maybe-const-set>>, CharT>
(exposition-only member object*)

[edit] Member functions

(constructor)
constructs a range-default-formatter
(public member function)
parse
parses the format specifier as specified by range-format-spec
(public member function)
format
writes the range formatted output as specified by range-format-spec
(public member function)

std::range-default-formatter<std::range_format::set>::range-default-formatter

constexpr range-default-formatter();

Equivalent to a call to underlying_.set_brackets(STATICALLY_WIDEN<CharT>("{"), STATICALLY_WIDEN<CharT>("}"))

where STATICALLY_WIDEN<CharT>("...") is "..." if CharT is char, and L"..." if CharT is wchar_t.

std::range-default-formatter<std::range_format::set>::parse

template< class ParseContext >
constexpr auto parse( ParseContext& ctx ) -> ParseContext::iterator;

Equivalent to return underlying_.parse(ctx);.

Returns an iterator past the end of the range-format-spec.

std::range-default-formatter<std::range_format::set>::format

template< class FormatContext >
auto format( maybe-const-set& r, FormatContext& ctx ) const -> FormatContext::iterator;

Equivalent to return underlying_.format(r, ctx);.

Returns an iterator past the end of the output range.

[edit] See also

(C++20)
defines formatting rules for a given type
(class template) [edit]
class template that helps implementing std::formatter specializations for range types
(class template) [edit]