Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions include/cista/reflection/to_tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ auto to_ptrs(T&& t) {

template <typename T>
inline constexpr auto to_tuple_works_v =
detail::has_cista_members_v<T> || (std::is_aggregate_v<T> &&
detail::has_cista_members_v<T> ||
(std::is_aggregate_v<T> &&
#if !defined(_MSC_VER) || defined(NDEBUG)
std::is_standard_layout_v<T> &&
std::is_standard_layout_v<T> &&
#endif
!std::is_polymorphic_v<T>);
!std::is_polymorphic_v<T> && !std::is_union_v<T>);

template <typename T,
std::enable_if_t<detail::has_cista_members_v<T> && std::is_const_v<T>,
Expand Down
2 changes: 1 addition & 1 deletion test/cista_members_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace cista_members_printable {

struct x {};
struct a : public x {
CISTA_PRINTABLE(a)
CISTA_PRINTABLE(a, )
auto cista_members() noexcept { return std::tie(a_, b_, c_); }
int a_{1}, b_{2}, c_{3};
};
Expand Down
2 changes: 1 addition & 1 deletion test/printable_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace {
enum class Color : int { RED, BLUE, GREEN };

struct a {
CISTA_PRINTABLE(a)
CISTA_PRINTABLE(a, )
int i_ = 1;
int j_ = 2;
double d_ = 100.0;
Expand Down