This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Help with bit-field semantics in C and C++
Michael Matz <matz@suse.de> writes:
> In this case I think the C++ standard should be changed in a way to not
> require a masking operation for each and every assignment from an integer
> of which the range is unknown. Yes this masking happens only for such
> casts, and not for every operation if the operands are enums already, but
> it still will hurt performance in the real world.
Do you think that assignments from non-enum to enum are frequent
operations in C++? I don't think so. The explicit cast also suggests
that the conversion may not be a nop.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."