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

functional, glift: use fold overload of IdString::in instead of pool … #4709

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

Conversation

widlarizer
Copy link
Collaborator

…literals

We have the following methods:

template<typename... Args>
bool IdString::in(Args... args) const;
bool IdString::in(const pool<IdString> &rhs) const;

The celltype.in(ID($add), ...) pattern uses the former while celltype.in({ID($add), ...}) forces the latter since the argument is an std::initializer_list<pool<IdString>>. The former probably has lower runtime overhead since instead of hashing and resizing a hash table it just finds the celltype in a compile-time known list of IDs, so we can switch to it whenever manually listing like a dozen IDs to check against.

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