Try to use templating to deduct types when dealing with complex structs
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 14:35:54 -04:00
parent 47a681e369
commit 3d8bc6c96a

View File

@ -67,9 +67,17 @@ void extract_from_toml_table(
);
template<typename T>
auto to_toml_table(const T& obj) -> toml::table;
auto to_toml_table(const T& obj) -> toml::table
{
toml::table result;
result = to_toml_table(obj);
return result;
}
template<typename T>
void from_toml_table(const toml::table& tbl, T& result);
void from_toml_table(const toml::table& tbl, T& result)
{
from_toml_table(tbl, result);
}
#define IOCORE_TOML_TO(field) insert_in_toml_table(tbl, #field, obj.field);
#define IOCORE_TOML_FROM(field) \