Closed mattkretz closed 7 years ago
"I think std::bitset should have used the mask approach."
Agreed. all_of, any_of, none_of are names of algorithms in [alg.nonmodifying], and having them as non-member functions feels "right".
If someone desperately wants none/any/all member functions in datapar's mask, we can add them (as a redundant thing).
Suggestion: Add a section "naming" (you should already have one for the datapar naming), and have a subsection "mask queries" or so, and show the two options, with preference to the current one.
Also, the "bit iterators" paper uses the free functions (algorithms) for bit sequences.
@jensmaurer: I just realized that
std::bitset
has the member functionsall
,any
,none
, andcount
whichmask
provides as non-member functionsall_of
,any_of
,none_of
, andpopcount
. I thinkstd::bitset
should have used themask
approach... But, should this influence thedatapar
/mask
design? I guess the paper should at least mention this? Any opinion?See e.g. http://en.cppreference.com/w/cpp/utility/bitset