LLVM 22.0.0git
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 > >:
[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 std::optional< HexPrintStyleconsumeHexStyle (StringRef &Str)
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 293 of file FormatProviders.h.

Member Function Documentation

◆ format()


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