Skip to content
Snippets Groups Projects
Commit 08d8bbd4 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

Merge branch 'fix_debug_for_older_compilers' into 'master'

[Debug] declare LOG_STR_LAMBDA's return type because gcc 8.3 can't infer it

See merge request !137
parents 990eadc2 2e768361
No related branches found
No related tags found
1 merge request!137[Debug] declare LOG_STR_LAMBDA's return type because gcc 8.3 can't infer it
Pipeline #59459 passed
......@@ -18,7 +18,7 @@
// The lamda should be fairly cheap/free because it will be inlined.
// The use of a lambda here is the ISO C++ equivalent to GCC statement expressions.
// NOLINTNEXTLINE(bugprone-macro-parentheses)
#define LOG_STR_LAMBDA(x, new_line) [&](){std::stringstream sst; sst << x; if constexpr (new_line) { sst << std::endl; }; return sst.str(); }
#define LOG_STR_LAMBDA(x, new_line) [&]() -> std::string {std::stringstream sst; sst << x; if constexpr (new_line) { sst << std::endl; }; return sst.str(); }
// NOLINTNEXTLINE(bugprone-macro-parentheses)
#define LOG(level, x, log_func, new_line) do {if constexpr (level > EMPER_LOG_LEVEL) { break; } log_func(LOG_STR_LAMBDA(x, new_line)()); } while (false)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment