12#ifndef ZEROERR_DISABLE_DBG_MARCO
13#define dbg(...) zeroerr::DebugExpr(__FILE__, __LINE__, __func__, #__VA_ARGS__, __VA_ARGS__)
15#define dbg(...) (__VA_ARGS__)
20template <
class T1,
class... T>
34template <
typename... Args>
36 return std::get<
sizeof...(Args) - 1>(std::tie(args...));
44template <
typename... T>
45auto DebugExpr(
const char* file,
unsigned line,
const char* func,
const char* exprs, T... t) ->
46 typename last<T...>::type {
58 for (
unsigned i = 0; i <
sizeof...(T); ++i) {
size_type find_last_of(char value, size_type pos=npos) const noexcept
定义 string.cpp:109
String substr(size_type pos=0, size_type count=npos) const
定义 string.cpp:127
static constexpr size_type npos
定义 string.h:47
#define ZEROERR_SUPPRESS_COMMON_WARNINGS_POP
定义 config.h:283
#define ZEROERR_SUPPRESS_COMMON_WARNINGS_PUSH
定义 config.h:235
const char * FgCyan
定义 color.cpp:48
auto DebugExpr(const char *file, unsigned line, const char *func, const char *exprs, T... t) -> typename last< T... >::type
DebugExpr is a function to print any type of variable with its type name. It is used by dbg macro.
定义 dbg.h:45
const char * Dim
定义 color.cpp:36
const char * FgGreen
定义 color.cpp:44
Printer & getStderrPrinter()
定义 print.cpp:14
auto get_last(Args &&... args) -> typename last< Args... >::type
get_last is a function to get the last argument of a variadic template. It is used by DebugExpr.
定义 dbg.h:35
const char * Reset
定义 color.cpp:34
A functor class Printer for printing a value of any type.
定义 print.h:87
StringBuffer & os
定义 print.h:134
static zeroerr::String type(const T &t)
定义 print.h:139
const char * line_break
定义 print.h:133
typename last< T... >::type type
定义 dbg.h:22