4#include <boost/format.hpp>
27template<
class F,
typename T,
typename... Args>
40 boost::io::all_error_bits ^
41 boost::io::too_many_args_bit ^
42 boost::io::too_few_args_bit);
67inline std::string
fmt(
const std::string &
s)
72inline std::string fmt(std::string_view
s)
74 return std::string(
s);
77inline std::string
fmt(
const char *
s)
82template<
typename...
Args>
83inline std::string
fmt(
const std::string & fs,
const Args & ...
args)
101 Magenta(
const T &
s) : value(
s) {}
106std::ostream & operator<<(std::ostream & out,
const Magenta<T> & y)
108 return out << ANSI_WARNING << y.value << ANSI_NORMAL;
121 Uncolored(
const T &
s) : value(
s) {}
126std::ostream & operator<<(std::ostream & out,
const Uncolored<T> & y)
128 return out << ANSI_NORMAL << y.value;
149 static HintFmt fromFormatString(
const std::string & format) {
150 return HintFmt(boost::format(format));
156 template<
typename... Args>
165 template<
typename... Args>
166 HintFmt(boost::format && fmt,
const Args & ...
args)
167 : fmt(std::move(fmt))
189 std::string str()
const
195std::ostream & operator<<(std::ostream & os,
const HintFmt & hf);
Some ANSI escape sequences.
HintFmt(const std::string &format, const Args &... args)
Definition fmt.hh:157
HintFmt(const std::string &literal)
Definition fmt.hh:145
void formatHelper(F &f)
Definition fmt.hh:24
std::string fmt(const std::string &s)
Definition fmt.hh:67
void setExceptions(boost::format &fmt)
Definition fmt.hh:37
Magenta(const T &s)
Definition lexer.l:491
formatHelper(f % x, args...)
return s
Definition lexer.l:459
T x
Definition lexer.l:2648
const T & value
Definition lexer.l:492
std::vector< Expr * > args
Definition lexer.l:6126