Adding exception ::as_string,

This commit is contained in:
Can Bölük 2020-08-24 00:23:30 +02:00
parent 7e85f61632
commit 6ce57af06d

View file

@ -31,6 +31,7 @@
#include <cstdio>
#include <type_traits>
#include <chrono>
#include <exception>
#include <optional>
#include "../util/lt_typeid.hpp"
#include "../util/type_helpers.hpp"
@ -166,6 +167,10 @@ namespace vtil::format
{
return std::to_string( x );
}
else if constexpr ( std::is_base_of_v<std::exception, T> )
{
return std::string{ x.what() };
}
else if constexpr ( std::is_same_v<base_type, std::string> ||
std::is_same_v<base_type, const char*> )
{