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

Return Builder on set* Methods #53

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

Conversation

brianv0
Copy link

@brianv0 brianv0 commented Mar 16, 2016

Better support for the builder pattern.

Better support for the builder pattern.
@brianv0
Copy link
Author

brianv0 commented Mar 16, 2016

Hi, I'm not sure if I got all the methods properly. In my limited tests, the output seems fine.

@idlsoft
Copy link

idlsoft commented Mar 31, 2022

There are drawbacks to doing this if you ever want to implement some sort of class hierarchy for your structs.
A setter from a base class will return a base builder, making it impossible to use a setter from a subclass.

I know it's not a problem now, because there is no struct inheritance, but it'd be nice to have that option at some point.

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