WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
compile.h File Reference
#include <iterator>
#include "format.h"

Go to the source code of this file.

Classes

class  compiled_string
 
struct  detail::is_compiled_string< S >
 

Namespaces

namespace  detail
 detail namespace with internal helper functions
 

Macros

#define FMT_COMPILE(s)
 Converts a string literal s into a format string that will be parsed at compile time and converted into efficient formatting code.
 

Functions

template<typename T , typename... Tail>
auto detail::first (const T &value, const Tail &...) -> const T &
 
template<typename OutputIt , typename S , typename... Args, FMT_ENABLE_IF(detail::is_compiled_string< S >::value) >
FMT_BEGIN_EXPORT auto format_to_n (OutputIt out, size_t n, const S &fmt, Args &&... args) -> format_to_n_result< OutputIt >
 
template<typename S , typename... Args, FMT_ENABLE_IF(detail::is_compiled_string< S >::value) >
FMT_CONSTEXPR20 auto formatted_size (const S &fmt, const Args &... args) -> size_t
 
template<typename S , typename... Args, FMT_ENABLE_IF(detail::is_compiled_string< S >::value) >
void print (std::FILE *f, const S &fmt, const Args &... args)
 
template<typename S , typename... Args, FMT_ENABLE_IF(detail::is_compiled_string< S >::value) >
void print (const S &fmt, const Args &... args)
 

Macro Definition Documentation

◆ FMT_COMPILE

#define FMT_COMPILE ( s)
Value:
#define FMT_STRING(s)
Constructs a legacy compile-time format string from a string literal s.
Definition format.h:4092

Converts a string literal s into a format string that will be parsed at compile time and converted into efficient formatting code.

Requires C++17 constexpr if compiler support.

Example:

// Converts 42 into std::string using the most efficient method and no
// runtime format string processing.
std::string s = fmt::format(FMT_COMPILE("{}"), 42);

Function Documentation

◆ format_to_n()

template<typename OutputIt , typename S , typename... Args, FMT_ENABLE_IF(detail::is_compiled_string< S >::value) >
FMT_BEGIN_EXPORT auto format_to_n ( OutputIt out,
size_t n,
const S & fmt,
Args &&... args ) -> format_to_n_result<OutputIt>

◆ formatted_size()

template<typename S , typename... Args, FMT_ENABLE_IF(detail::is_compiled_string< S >::value) >
FMT_CONSTEXPR20 auto formatted_size ( const S & fmt,
const Args &... args ) -> size_t

◆ print() [1/2]

template<typename S , typename... Args, FMT_ENABLE_IF(detail::is_compiled_string< S >::value) >
void print ( const S & fmt,
const Args &... args )

◆ print() [2/2]

template<typename S , typename... Args, FMT_ENABLE_IF(detail::is_compiled_string< S >::value) >
void print ( std::FILE * f,
const S & fmt,
const Args &... args )