LLVM 19.0.0git
Static Public Member Functions | List of all members
llvm::format_provider< T, std::enable_if_t< support::detail::use_double_formatter< T >::value > > Struct Template Reference

Implementation of format_provider<T> for floating point types. More...

#include "llvm/Support/FormatProviders.h"

Inheritance diagram for llvm::format_provider< T, std::enable_if_t< support::detail::use_double_formatter< T >::value > >:
Inheritance graph
[legend]

Static Public Member Functions

static void format (const T &V, llvm::raw_ostream &Stream, StringRef Style)
 

Additional Inherited Members

- Static Protected Member Functions inherited from llvm::support::detail::HelperFunctions
static std::optional< size_t > parseNumericPrecision (StringRef Str)
 
static bool consumeHexStyle (StringRef &Str, HexPrintStyle &Style)
 
static size_t consumeNumHexDigits (StringRef &Str, HexPrintStyle Style, size_t Default)
 

Detailed Description

template<typename T>
struct llvm::format_provider< T, std::enable_if_t< support::detail::use_double_formatter< T >::value > >

Implementation of format_provider<T> for floating point types.

The options string of a floating point type has the format:

float_options :: [style][precision] style :: precision :: <non-negative integer> 0-99


| style | Meaning | Example |

| | | Input | Output |

| P / p | Percentage | 0.05 | 5.00% | | F / f | Fixed point | 1.0 | 1.00 | | E | Exponential with E | 100000 | 1.0E+05 | | e | Exponential with e | 100000 | 1.0e+05 |

| (empty) | Same as F / f | | |

The default precision is 6 for exponential (E / e) and 2 for everything else.

Definition at line 302 of file FormatProviders.h.

Member Function Documentation

◆ format()

template<typename T >
static void llvm::format_provider< T, std::enable_if_t< support::detail::use_double_formatter< T >::value > >::format ( const T V,
llvm::raw_ostream Stream,
StringRef  Style 
)
inlinestatic

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