Closed julianharbarth closed 2 years ago
I think we could add an exception for to_tuple_works
and a specialization for cista::to_tuple
that creates a std::tie
from the tuple elements?
to_tuple_works should fail on this one:
struct unserializable { virtual auto f() { } };
and succeed on this one:
struct serializable { cista::tuple<int, int> t_; };
But you cannot specialize depending on the type of a member for cista::to_tuple, right?
superseded by #127
Fixes cista::get for cista::tuple with identical types. Enables structured bindings for cista::tuple.
Originally, I was trying to make
struct s { cista::tuple<int, int, int> t_; };
serialize by "default". It is not in standard layout due to the tuple implementation, so to_tuple_works always evaluates to false. It should serialize just fine in practice if the static_assert is disabled :). I think there is no possibility to catch this edge case in to_tuple_works, or is there?