We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
How do you deal with members of classes which are pointers. i.e.
class Bar { int a;}
static spotify::json::codec::object_t<Bar> codec() { auto codec = spotify::json::codec::object<Bar>(); codec.required("a", &Bar::a); return codec; }
class Foo { int b; Bar *c; }
static spotify::json::codec::object_t<Foo> codec() { auto codec = spotify::json::codec::object<Foo>(); codec.required("b", &Foo::b);
// how to represent Bar *c; return codec; }
How do I represent *c in the codec. I cant find any example which deals with a pointer.
Thanks
Paul
The text was updated successfully, but these errors were encountered:
If you can I would use std::unique_ptr<Bar> instead of Bar. The library supports this. Otherwise you can use transform_t.
std::unique_ptr<Bar>
Bar
transform_t
Sorry, something went wrong.
No branches or pull requests
Hi,
How do you deal with members of classes which are pointers. i.e.
class Bar
{ int a;}
class Foo
{
int b;
Bar *c;
}
// how to represent Bar *c;
return codec;
}
How do I represent *c in the codec. I cant find any example which deals with a pointer.
Thanks
Paul
The text was updated successfully, but these errors were encountered: