Scippy

SoPlex

Sequential object-oriented simPlex

compile.h File Reference
#include <vector>
#include "format.h"

Go to the source code of this file.

Classes

class  compiled_string
 
struct  is_compiled_string< S >
 
struct  format_part< Char >
 
struct  format_part< Char >::replacement
 
union  format_part< Char >::value
 
struct  part_counter< Char >
 
class  format_string_compiler< Char, PartHandler >
 
struct  basic_compiled_format
 
struct  compiled_format_base< S, typename >
 
struct  format_part_array< Char, N >
 
struct  compiled_format_base< S, enable_if_t< is_compile_string< S >::value > >
 
class  compiled_format< S, Args >
 

Namespaces

 detail
 
 detail::cf
 

Macros

#define FMT_COMPILE(s)   FMT_STRING_IMPL(s, fmt::detail::compiled_string)
 

Functions

template<typename T , typename... Tail>
const T & first (const T &value, const Tail &...)
 
template<typename Char >
FMT_CONSTEXPR unsigned count_parts (basic_string_view< Char > format_str)
 
template<bool IS_CONSTEXPR, typename Char , typename PartHandler >
FMT_CONSTEXPR void compile_format_string (basic_string_view< Char > format_str, PartHandler handler)
 
template<typename OutputIt , typename Context , typename Id >
void format_arg (basic_format_parse_context< typename Context::char_type > &parse_ctx, Context &ctx, Id arg_id)
 
template<typename Context , typename OutputIt , typename CompiledFormat >
auto vformat_to (OutputIt out, CompiledFormat &cf, basic_format_args< Context > args) -> typename Context::iterator
 
template<typename Char , unsigned N>
FMT_CONSTEXPR format_part_array< Char, N > compile_to_parts (basic_string_view< Char > format_str)
 
template<typename T >
constexpr const T & constexpr_max (const T &a, const T &b)
 
template<typename... Args, typename S , FMT_ENABLE_IF(is_compile_string< S >::value) >
constexpr auto compile (S format_str) -> detail::compiled_format< S, Args... >
 
template<typename... Args, typename Char , size_t N>
auto compile (const Char(&format_str)[N]) -> detail::compiled_format< const Char *, Args... >
 
template<typename... Args>
FMT_DEPRECATED auto compile (const Args &... args) -> decltype(detail::compile(args...))
 
template<typename CompiledFormat , typename... Args, typename Char = typename CompiledFormat::char_type, FMT_ENABLE_IF(std::is_base_of< detail::basic_compiled_format, CompiledFormat >::value) >
std::basic_string< Char > format (const CompiledFormat &cf, const Args &... args)
 
template<typename S , typename... Args, FMT_ENABLE_IF(detail::is_compiled_string< S >::value) >
FMT_INLINE std::basic_string< typename S::char_type > format (const S &, Args &&... args)
 
template<typename OutputIt , typename CompiledFormat , typename... Args, FMT_ENABLE_IF(std::is_base_of< detail::basic_compiled_format, CompiledFormat >::value) >
OutputIt format_to (OutputIt out, const CompiledFormat &cf, const Args &... args)
 
template<typename OutputIt , typename S , typename... Args, FMT_ENABLE_IF(detail::is_compiled_string< S >::value) >
OutputIt format_to (OutputIt out, const S &, const Args &... args)
 
template<typename OutputIt , typename CompiledFormat , typename... Args>
auto format_to_n (OutputIt out, size_t n, const CompiledFormat &cf, const Args &... args) -> typename std::enable_if< detail::is_output_iterator< OutputIt, typename CompiledFormat::char_type >::value &&std::is_base_of< detail::basic_compiled_format, CompiledFormat >::value, format_to_n_result< OutputIt >>::type
 
template<typename OutputIt , typename S , typename... Args, FMT_ENABLE_IF(detail::is_compiled_string< S >::value) >
format_to_n_result< OutputIt > format_to_n (OutputIt out, size_t n, const S &, const Args &... args)
 
template<typename CompiledFormat , typename... Args>
size_t formatted_size (const CompiledFormat &cf, const Args &... args)
 

Macro Definition Documentation

◆ FMT_COMPILE

#define FMT_COMPILE (   s)    FMT_STRING_IMPL(s, fmt::detail::compiled_string)

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);

Definition at line 37 of file compile.h.

Function Documentation

◆ compile()

FMT_DEPRECATED auto compile ( const Args &...  args) -> decltype(detail::compile(args...))

◆ format() [1/2]

std::basic_string<Char> format ( const CompiledFormat &  cf,
const Args &...  args 
)

Definition at line 629 of file compile.h.

References FMT_ENABLE_IF, and to_string().

Referenced by compile(), compiled_format< S, Args >::compiled_format(), and format().

◆ format() [2/2]

FMT_INLINE std::basic_string<typename S::char_type> format ( const S &  ,
Args &&...  args 
)

Definition at line 639 of file compile.h.

References detail::compile(), detail::first(), FMT_ENABLE_IF, format(), and to_string().

◆ format_to() [1/2]

OutputIt format_to ( OutputIt  out,
const CompiledFormat &  cf,
const Args &...  args 
)

Definition at line 655 of file compile.h.

References detail::char_type, and FMT_ENABLE_IF.

Referenced by compile(), format_to(), format_to_n(), and formatted_size().

◆ format_to() [2/2]

OutputIt format_to ( OutputIt  out,
const S &  ,
const Args &...  args 
)

Definition at line 665 of file compile.h.

References detail::compile(), and format_to().

◆ format_to_n() [1/2]

auto format_to_n ( OutputIt  out,
size_t  n,
const CompiledFormat &  cf,
const Args &...  args 
) -> typename std::enable_if< detail::is_output_iterator<OutputIt, typename CompiledFormat::char_type>::value && std::is_base_of<detail::basic_compiled_format, CompiledFormat>::value, format_to_n_result<OutputIt>>::type

Definition at line 671 of file compile.h.

References FMT_ENABLE_IF, and format_to().

◆ format_to_n() [2/2]

format_to_n_result<OutputIt> format_to_n ( OutputIt  out,
size_t  n,
const S &  ,
const Args &...  args 
)

Definition at line 686 of file compile.h.

References detail::compile(), and format_to().

◆ formatted_size()

size_t formatted_size ( const CompiledFormat &  cf,
const Args &...  args 
)

Definition at line 695 of file compile.h.

References FMT_END_NAMESPACE, and format_to().