From b1cd193f1bd28837a00cbe6629f9a562f99d961f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 17 Dec 2017 09:13:30 +0200 Subject: Add to_string(process_exit) in addition to operator<<(ostream,process_exit) --- libbutl/process.mxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'libbutl/process.mxx') diff --git a/libbutl/process.mxx b/libbutl/process.mxx index 27c13fa..199273b 100644 --- a/libbutl/process.mxx +++ b/libbutl/process.mxx @@ -15,7 +15,7 @@ #ifndef __cpp_lib_modules #include #include -#include +#include #include // size_t #include // uint32_t #include @@ -200,7 +200,7 @@ LIBBUTL_MODEXPORT namespace butl description () const; }; - // Print canonical exit status diagnostics: + // Canonical exit status description: // // "terminated abnormally: <...> (core dumped)" // "exited with code <...>" @@ -209,8 +209,14 @@ LIBBUTL_MODEXPORT namespace butl // // cerr << "process " << args[0] << " " << *pr.exit << endl; // - LIBBUTL_SYMEXPORT std::ostream& - operator<< (std::ostream&, process_exit); + LIBBUTL_SYMEXPORT std::string + to_string (process_exit); + + inline std::ostream& + operator<< (std::ostream& os, process_exit pe) + { + return os << to_string (pe); + } class LIBBUTL_SYMEXPORT process { -- cgit v1.1