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.
…literals
We have the following methods:
The
celltype.in(ID($add), ...)
pattern uses the former whilecelltype.in({ID($add), ...})
forces the latter since the argument is anstd::initializer_list<pool<IdString>>
. The former probably has lower runtime overhead since instead of hashing and resizing a hash table it just finds thecelltype
in a compile-time known list of IDs, so we can switch to it whenever manually listing like a dozen IDs to check against.