Skip to content

Constructors added to structs seem to mess with the serialization. #767

Answered by stephenberry
CezarZbughin asked this question in Q&A
Discussion options

You must be logged in to vote

I've documented the fix here as well: #721. The solution is to add another constructor that enables brace initialization for Glaze.

Simply add the following constructor: A(glz::make_reflectable) {}

In full:

struct A {
    int x = 0;

    A(glz::make_reflectable) {}
    A() = default;
    A(int) {}; //Comment & uncomment this constructor.
};

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by stephenberry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants