15 #ifndef PAAL_SYSTEM_MESSAGE_HPP
16 #define PAAL_SYSTEM_MESSAGE_HPP
28 output_stream << std::endl;
32 template <
typename Arg,
typename ...Args>
33 auto print_message(std::ostream &output_stream, Arg &&arg, Args... args) {
39 template <
typename Arg,
typename ...Args>
40 auto info(Arg &&arg, Args... args) {
41 print_message(std::cout, std::forward<Arg>(arg), std::forward<Args>(args)...);
45 template <
typename Arg,
typename ...Args>
47 static const std::string message_prefix =
"Warning: ";
48 print_message(std::cerr, message_prefix, std::forward<Arg>(arg), std::forward<Args>(args)...);
52 template <
typename Arg,
typename ...Args>
54 static const std::string message_prefix =
"Failure: ";
55 print_message(std::cerr, message_prefix, std::forward<Arg>(arg), std::forward<Args>(args)...);
56 std::exit(EXIT_FAILURE);
62 template <
typename Arg,
typename ...Args>
64 failure(std::forward<Arg>(arg), std::forward<Args>(args)...);
72 #endif // PAAL_SYSTEM_MESSAGE_HPP
auto info(Arg &&arg, Args...args)
prints info message
void operator()(Arg &&arg, Args...args)
operator()
auto warning(Arg &&arg, Args...args)
prints warning message
Functor prints failure message.
auto failure(Arg &&arg, Args...args)
prints failure message
auto print_message(std::ostream &output_stream)
prints message (specialization for empty message)