From f21035f8afc5add5fedbe421347e020e9f7c6096 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 15 Sep 2021 07:58:24 +0300 Subject: [PATCH] Move location to the end of what() --- include/boost/system/system_error.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/boost/system/system_error.hpp b/include/boost/system/system_error.hpp index f3f1701..bc4a848 100644 --- a/include/boost/system/system_error.hpp +++ b/include/boost/system/system_error.hpp @@ -43,8 +43,12 @@ private: r += ": "; } + r += ec.message(); + if( ec.has_location() ) { + r += " ["; + boost::source_location loc = ec.location(); r += loc.file_name(); @@ -63,11 +67,9 @@ private: r += "\': "; r += ec.to_string(); - r += ": "; + r += "]"; } - r += ec.message(); - return r; }