kabasset / Linx

Extensible ND image laboratory
Apache License 2.0
3 stars 0 forks source link

Implement Mask::invert() #10

Open kabasset opened 1 year ago

kabasset commented 1 year ago

Or anything better named, e.g. operator-() for new instance, or match bitset wording.

kabasset commented 1 year ago

bitset provides flip() which is ambiguous wrt. flipping the ordering. Operators ! or ~ seem appropriate for new instances. One would write:

for (const auto& p : not mask) ...
for (const auto& p : !mask) ...
for (const auto& p : ~mask) ...
kabasset commented 1 year ago

bitset uses operator~() while valarray<bool> uses both while seems to favor operator!