mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -25,9 +25,8 @@ private:
|
||||
};
|
||||
|
||||
template <typename Fn, typename... Args>
|
||||
std::invoke_result_t<Fn&&, Args&&...> ExceptionCatcher(std::string const & comment,
|
||||
bool & exceptionWasThrown, Fn && fn,
|
||||
Args &&... args) noexcept
|
||||
std::invoke_result_t<Fn &&, Args &&...> ExceptionCatcher(std::string const & comment, bool & exceptionWasThrown,
|
||||
Fn && fn, Args &&... args) noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -48,24 +47,24 @@ std::invoke_result_t<Fn&&, Args&&...> ExceptionCatcher(std::string const & comme
|
||||
}
|
||||
|
||||
exceptionWasThrown = true;
|
||||
using ReturnType = std::decay_t<std::invoke_result_t<Fn&&, Args&&...>>;
|
||||
using ReturnType = std::decay_t<std::invoke_result_t<Fn &&, Args &&...>>;
|
||||
if constexpr (!std::is_same_v<void, ReturnType>)
|
||||
{
|
||||
static const ReturnType defaultResult = {};
|
||||
static ReturnType const defaultResult = {};
|
||||
return defaultResult;
|
||||
}
|
||||
}
|
||||
|
||||
#define DECLARE_EXCEPTION(exception_name, base_exception) \
|
||||
class exception_name : public base_exception \
|
||||
{ \
|
||||
public: \
|
||||
#define DECLARE_EXCEPTION(exception_name, base_exception) \
|
||||
class exception_name : public base_exception \
|
||||
{ \
|
||||
public: \
|
||||
exception_name(char const * what, std::string const & msg) : base_exception(what, msg) {} \
|
||||
}
|
||||
|
||||
// TODO: Use SRC_LOGGING macro.
|
||||
#define MYTHROW(exception_name, msg) throw exception_name( \
|
||||
#exception_name " " __FILE__ ":" TO_STRING(__LINE__), ::base::Message msg)
|
||||
#define MYTHROW(exception_name, msg) \
|
||||
throw exception_name(#exception_name " " __FILE__ ":" TO_STRING(__LINE__), ::base::Message msg)
|
||||
|
||||
#define MYTHROW1(exception_name, param1, msg) throw exception_name(param1, \
|
||||
#exception_name " " __FILE__ ":" TO_STRING(__LINE__), ::base::Message msg)
|
||||
#define MYTHROW1(exception_name, param1, msg) \
|
||||
throw exception_name(param1, #exception_name " " __FILE__ ":" TO_STRING(__LINE__), ::base::Message msg)
|
||||
|
||||
Reference in New Issue
Block a user