Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing serialization of classes with incompatible serialize signature #3156

Merged
merged 1 commit into from Feb 12, 2018

Conversation

AntonBikineev
Copy link
Contributor

This fixes #3134

struct two_chars
{
char _[2];
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use std::true_type and std::false_type here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I can think of.
Do you mean to use std::true/false_type as the return types for the test functions? If so, I don't think it makes a big difference. If you mean to inherit from std::true/false_type, then see the related discussion in #3134 why it didn't work for gcc.

Copy link
Member

@hkaiser hkaiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thank you so much!

@AntonBikineev
Copy link
Contributor Author

@hkaiser thanks for letting me work on this!


public:
static constexpr bool value =
sizeof(test<T>(0)) == sizeof(two_chars);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related to the above discussion ... I was thinking of why for example value = decltype(test<T>(0))::value; didn't work. It looks like this is unrelated to the discussion in #3134. If this is the only way to get it to work, there's nothing one can do, right?

@AntonBikineev
Copy link
Contributor Author

@sithhell yeah, I agree. It does look better now.

Copy link
Member

@sithhell sithhell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM now!

@sithhell sithhell merged commit bac5a9d into master Feb 12, 2018
@sithhell sithhell deleted the fix_3134 branch February 12, 2018 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HPX_SERIALIZATION_SPLIT_FREE does not stop compiler from looking for serialize() method
3 participants