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

Fix and rename Config::find to Config::filter #452

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

Conversation

markuspg
Copy link
Contributor

I always scratched my head looking at Config Config::find(const string &pro), wondering about its purpose. If I don't misinterpret it it creates a new instance of Config - holding all default ConfigItems and then adds the ones of the current instance additionally which fit the passed protocol.

Since I guess it should rather filter I modified the Config constructor to allow creating an instance without any ConfigItems and then adding just selected ones within the filter function.

{
Config items;
Config items{true};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not really satisfied with the default argument approach. An alternative would be to leave the constructor unchanged and just call a clear on items before entering into the below for loop to start off from scratch.

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.

1 participant