mattkretz / wg21-papers

my papers to WG21 — the C++ committee
5 stars 7 forks source link

should mask follow bitset? #50

Closed mattkretz closed 7 years ago

mattkretz commented 7 years ago

@jensmaurer: I just realized that std::bitset has the member functions all, any, none, and count which mask provides as non-member functions all_of, any_of, none_of, and popcount. I think std::bitset should have used the mask approach... But, should this influence the datapar/mask design? I guess the paper should at least mention this? Any opinion?

See e.g. http://en.cppreference.com/w/cpp/utility/bitset

jensmaurer commented 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.

mattkretz commented 7 years ago

grafik

jensmaurer commented 7 years ago

Also, the "bit iterators" paper uses the free functions (algorithms) for bit sequences.