Prevent a recursive call to to_toml_table and from_toml_table by adding _impl at the end of the non-templated variants
All checks were successful
buildbot/IOCore-linux-builder Build done.
buildbot/IOCore-macos-builder Build done.
buildbot/IOCore-freebsd-builder Build done.

This commit is contained in:
S David 2024-08-13 15:01:13 -04:00
parent c096918e78
commit 16f9fb3f70

View File

@ -69,13 +69,13 @@ void extract_from_toml_table(
template<typename T>
auto to_toml_table(const T& obj) -> toml::table
{
auto result = to_toml_table(obj);
auto result = to_toml_table_impl(obj);
return result;
}
template<typename T>
void from_toml_table(const toml::table& tbl, T& result)
{
from_toml_table(tbl, result);
from_toml_table_impl(tbl, result);
}
#define IOCORE_TOML_TO(field) insert_in_toml_table(tbl, #field, obj.field);
@ -88,14 +88,14 @@ void from_toml_table(const toml::table& tbl, T& result)
return #CLASS; \
} \
\
friend auto to_toml_table(const CLASS& obj)->toml::table \
friend auto to_toml_table_impl(const CLASS& obj)->toml::table \
{ \
toml::table tbl; \
FOREACH_PARAM(IOCORE_TOML_TO, __VA_ARGS__) \
return tbl; \
} \
\
friend void from_toml_table(const toml::table& tbl, CLASS& result) \
friend void from_toml_table_impl(const toml::table& tbl, CLASS& result) \
{ \
FOREACH_PARAM(IOCORE_TOML_FROM, __VA_ARGS__) \
}