mattkretz / wg21-papers

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

Consider a simpler where overload for const memload with 0 init. #54

Open mattkretz opened 7 years ago

mattkretz commented 7 years ago

See also #32.

The problem with having a simpler overload is that the second argument to where determines the return type of the memload function. Wanting to have some default-to-zero variant, means that the type information is lost. The only remaining information now, is the mask<T, A> argument. In principle we could just fall back to it. However, there's no correct scalar overload for it anymore.

The overload is not necessary for better code-gen. The compiler can do the right thing all by itself: https://godbolt.org/g/LCFSfs