2
0
mirror of https://github.com/boostorg/pfr.git synced 2026-01-19 04:22:13 +00:00

better error messages

This commit is contained in:
Andrzej Krzemienski
2020-10-19 22:06:48 +02:00
parent 43c671a2ee
commit 5a1cc330b9
4 changed files with 117 additions and 109 deletions

View File

@@ -50,7 +50,7 @@ constexpr auto tie_as_tuple(T& /*val*/, size_t_<0>) noexcept {
template <class T>
constexpr auto tie_as_tuple(T& val, size_t_<1>, std::enable_if_t<std::is_class< std::remove_cv_t<T> >::value>* = 0) noexcept {
auto& [a] = val;
auto& [a] = val; // ====================> Boost.PFR: User-provided type is not a SimpleAggregate.
return ::boost::pfr::detail::make_tuple_of_references(a);
}
@@ -89,18 +89,18 @@ for i in xrange(1, funcs_count):
indexes += ","
if i >= max_args_on_a_line:
indexes += ascii_letters[i / max_args_on_a_line - 1]
indexes += ascii_letters[i / max_args_on_a_line - 1]
indexes += ascii_letters[i % max_args_on_a_line]
print "template <class T>"
print "constexpr auto tie_as_tuple(T& val, size_t_<" + str(i + 1) + ">) noexcept {"
if i < max_args_on_a_line:
print " auto& [" + indexes.strip() + "] = val;"
print " auto& [" + indexes.strip() + "] = val; // ====================> Boost.PFR: User-provided type is not a SimpleAggregate."
print " return ::boost::pfr::detail::make_tuple_of_references(" + indexes.strip() + ");"
else:
print " auto& ["
print indexes
print " ] = val;"
print " ] = val; // ====================> Boost.PFR: User-provided type is not a SimpleAggregate."
print ""
print " return ::boost::pfr::detail::make_tuple_of_references("
print indexes