VCCC  2024.05
VisualCamp Common C++ library
literal

Python-like _format library. More...

Detailed Description

Classes

class  Formatter
 converts c-style format and inputs to std::string More...
 

Functions

Formatter operator""_format (const char *format, std::size_t)
 Formatter helper on string literal. More...
 

Function Documentation

◆ operator""_format()

Formatter vccc::operator""_format ( const char *  format,
std::size_t   
)
inline
Parameters
formatc-style string literal format
Returns
Formatter
std::string str = "x:%d, hello %s"_format(13, "world!");
vccc::Formatter fmt = "%s"_format;
std::string str2 = fmt("Hello, world!");
converts c-style format and inputs to std::string
Definition: formatter.hpp:26