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

Allow final structs & classes serialization #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DavidKeller
Copy link

Hi,

I can't serialize a class T marked as final because the detail::has_memfn_serializer<> metafunction relies on the following trick to detect the serialize function presence.

struct derived: T {
        using T::serialize;
        no serialize(...) const;
};

I've updated the tests/base/include/json_conformance.hpp to add final to the tested class in order to experience the limitation.

This MR provides another implementation of the detail::has_memfn_serializer<> metafunction, but it ignores the return type of the T::serialize() function. I'm not comfortable with this choice because in your implementation, my understanding is that you ignore the return type as well, but it seems there is some facility to check it (i.e. return_value_check) ¯_(ツ)_/¯.

Some tests are failing as well on my Fedora 39, and there are warnings.

Do you want me to do some cleaning ?

Signed-off-by: David Keller <david.keller@litchis.fr>
@niXman
Copy link
Owner

niXman commented Feb 18, 2025

hi,

sorry for the delay.
will look at this this weekend.

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants