assert
This commit is contained in:
@@ -17,3 +17,11 @@ public:
|
||||
|
||||
virtual char const* what() const noexcept;
|
||||
};
|
||||
|
||||
#if DEBUG == 1
|
||||
/// Use this macro to find bugs in debug build. Release build could be compiled without asserts. Define DEBUG=1 to enable assert compilation.
|
||||
#define assert(EXPR, ERRMSG) if(!EXPR) throw UsefulException(ERRMSG);
|
||||
#else
|
||||
/// Use this macro to find bugs in debug build. Release build could be compiled without asserts. Define DEBUG=1 to enable assert compilation.
|
||||
#define assert(EXPR, ERRMSG) EXPR
|
||||
#endif
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "UsefulException.hpp"
|
||||
#include "../dependencies/kerep/src/base/base.h"
|
||||
|
||||
std::string format(const std::string format_str, size_t args_count, ...){
|
||||
std::string _format(const std::string format_str, size_t args_count, ...){
|
||||
va_list vl;
|
||||
va_start(vl, args_count);
|
||||
std::stringstream ss;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "../dependencies/kerep/src/base/std.h"
|
||||
|
||||
std::string format(const std::string format_str, size_t args_count, ...);
|
||||
std::string _format(const std::string format_str, size_t args_count, ...);
|
||||
#define format(FORMAT_STR, ARGS...) _format(FORMAT_STR, count_args(ARGS) ,##ARGS)
|
||||
|
||||
Reference in New Issue
Block a user