20namespace barretenberg {
29void _debug_log_impl(
const std::string& log_str);
32concept Printable =
requires(T
a) {
std::cout <<
a; };
34concept ContainerLike =
requires(T
a) {
39template <
typename T>
const char* _summarize(
const T* )
44template <Pr
intable T>
const T& _summarize(
const T* x)
50template <ContainerLike T>
51std::string _summarize(
const T* x)
52 requires(!Printable<T>)
54 std::ostringstream ss;
58 ss <<
"[" << _summarize(&*x->begin()) <<
"...]";
68template <
typename... FuncArgs>
void _debug_log(
const char* func_name,
const char* arg_string,
const FuncArgs&... args)
71 static size_t debug_log_calls = 0;
72 if (debug_log_calls > 0) {
76 std::ostringstream ss;
77 ss << func_name <<
" " << arg_string <<
" = ";
79 ((ss << _summarize(&args) <<
" "), ...);
80 std::string log_str = ss.str();
82 _debug_log_impl(log_str);
92#define DEBUG_LOG(...) \
93 if (!std::is_constant_evaluated()) { \
94 barretenberg::_debug_log(__FUNCTION__, #__VA_ARGS__, __VA_ARGS__); \
97#define DEBUG_LOG_ALL(container) \
98 for (auto& x : (container)) { \
99 barretenberg::_debug_log(__FUNCTION__, #container, x); \
105#define DEBUG_LOG(...)
106#define DEBUG_LOG_ALL(container)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept