19 template <
typename ...T>
pass(T...) {}
25 void print_(std::ostream& o,
const T& arg,
long)
33 inline void print_(std::ostream& o, std::istream&
is,
long)
37 std::getline(is, buf,
'\n');
45 inline void print_(std::ostream& o, std::istringstream&
is,
long)
47 print_(o, static_cast<std::istream&>(is), 0);
52 auto print_(std::ostream& o,
const T& arg,
int)
53 -> decltype(arg.print_set(o),
void())
60 template <
typename... Args>
62 inline void raise(Args&&... args)
65 using swallow =
int[];
70 throw std::runtime_error{o.str()};
77 template <
typename Bool,
typename... Args>
81 raise(std::forward<Args>(args)...);
89 #define VCSN_REQUIRE(Cond, ...) \
92 ::vcsn::raise(__VA_ARGS__); \
void require(Bool b, Args &&...args)
If b is not verified, raise an error with args as message.
std::ostream & str_escape(std::ostream &os, const std::string &str, const char *special=nullptr)
Output a string, escaping special characters.
Provide a variadic mul on top of a binary mul(), and one().
void print_(std::ostream &o, const T &arg, long)
Serialize arg into o.
std::istringstream is
The input stream: the specification to translate.