LLVM 19.0.0git
Static Public Member Functions | List of all members
llvm::format_provider< llvm::iterator_range< IterT > > Class Template Reference

Implementation of format_provider<T> for ranges. More...

#include "llvm/Support/FormatProviders.h"

Static Public Member Functions

static void format (const llvm::iterator_range< IterT > &V, llvm::raw_ostream &Stream, StringRef Style)
 

Detailed Description

template<typename IterT>
class llvm::format_provider< llvm::iterator_range< IterT > >

Implementation of format_provider<T> for ranges.

This will print an arbitrary range as a delimited sequence of items.

The options string of a range type has the grammar:

range_style ::= [separator] [element_style] separator ::= "$" delimeted_expr element_style ::= "@" delimeted_expr delimeted_expr ::= "[" expr "]" | "(" expr ")" | "<" expr ">" expr ::= <any string not containing delimeter>

where the separator expression is the string to insert between consecutive items in the range and the argument expression is the Style specification to be used when formatting the underlying type. The default separator if unspecified is ' ' (space). The syntax of the argument expression follows whatever grammar is dictated by the format provider or format adapter used to format the value type.

Note that attempting to format an iterator_range<T> where no format provider can be found for T will result in a compile error.

Definition at line 362 of file FormatProviders.h.

Member Function Documentation

◆ format()

template<typename IterT >
static void llvm::format_provider< llvm::iterator_range< IterT > >::format ( const llvm::iterator_range< IterT > &  V,
llvm::raw_ostream Stream,
StringRef  Style 
)
inlinestatic

Definition at line 403 of file FormatProviders.h.

References llvm::support::detail::build_format_adapter(), and End.


The documentation for this class was generated from the following file: