CMakeLists.txt: requires C++23 standard

CMakeLists.txt: add compiler version checks
adc_netserver.h: add AdcTrivialLogger class (use of 'deduced this'
feature of C++23 standard); AdcGenericNetServer class now has basic
based on std::basic_ostream logging capability
This commit is contained in:
2024-11-11 18:36:54 +03:00
parent afa8d09ade
commit 6acc1f94ba
5 changed files with 143 additions and 20 deletions

View File

@@ -758,10 +758,19 @@ public:
}
static void formatError(std::error_code err, std::string& result_str)
// static void formatError(std::error_code err, std::string& result_str)
// {
// std::format_to(std::back_inserter(result_str), "{} (Err category: {}) (Err msg: {})", err.value(),
// err.category().name(), err.message());
// }
static std::string formattableError(std::error_code ec)
{
std::format_to(std::back_inserter(result_str), "{} (Err category: {}) (Err msg: {})", err.value(),
err.category().name(), err.message());
std::string s;
std::format_to(std::back_inserter(s), "{} (Err category: {}) (Err msg: {})", ec.value(), ec.category().name(),
ec.message());
return s;
}
protected: