Re: Compiletime check for bit-positions in bit-field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2019-12-04 at 14:50 +0100, Klaus Doldinger wrote:
> Hello,
> 
> does anybody see a possibility to perform a compiletime-check to verify
> that a bit of a bit-field is at an exact position of the underlying type?
> 
> I would see a possible using the forecoming std::bit_cast, but what can
> one do with c++17?
> 

Perhaps have a look at this approach
https://blog.codef00.com/2014/12/06/portable-bitfields-using-c11/

If it doesn't already implement bit position range limit checking, it
shouldn't be too difficult to add.

Cheers,
Oleg




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux