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

std::set<T> instead of std::vector<T>? #670

Open
Yurlungur opened this issue Apr 28, 2022 · 1 comment
Open

std::set<T> instead of std::vector<T>? #670

Yurlungur opened this issue Apr 28, 2022 · 1 comment
Labels

Comments

@Yurlungur
Copy link
Collaborator

There are a number of places throughout Parthenon where we either use std::vector<std::string> or std::vector<Metadata>. Perhaps we should move to std::set, which is unique and ordered, and has a count method to check for existence. This would allow for validation logic like "is a particular variable string that I care about in this list of variable names?" for example.

What do people think?

@pgrete
Copy link
Collaborator

pgrete commented May 5, 2022

I think this would make sense.
It also add a kind of failsafe to not have duplicate entries by definition.

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

No branches or pull requests

2 participants