preCICE v3.1.1
Loading...
Searching...
No Matches
ArgumentFormatter.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <boost/preprocessor/control/if.hpp>
4#include <boost/preprocessor/seq/for_each_i.hpp>
5#include <boost/preprocessor/stringize.hpp>
6#include <boost/preprocessor/variadic/to_seq.hpp>
7#include <boost/vmd/is_empty.hpp>
8
9#include "utils/fmt.hpp"
10
12#define PRECICE_LOG_ARGUMENTS_FMT(r, data, i, elem) \
13 " " BOOST_PP_STRINGIZE(i) ": " BOOST_PP_STRINGIZE(elem) " == {}\n"
14
15#define PRECICE_LOG_ARGUMENTS(...) \
16 BOOST_PP_IF(BOOST_VMD_IS_EMPTY(__VA_ARGS__), \
17 "", \
18 ::precice::utils::format_or_error( \
19 "\n" BOOST_PP_SEQ_FOR_EACH_I(PRECICE_LOG_ARGUMENTS_FMT, , BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)), \
20 __VA_ARGS__))