|
Boost : |
Subject: Re: [boost] How best to implement a bitfield in C++ 14?
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2016-02-06 04:27:50
Le 04/02/2016 00:47, Vicente J. Botet Escriba a écrit :
> Le 03/02/2016 10:01, Niall Douglas a écrit :
>> AFIO v2's current bitfield has an example of usage at
>> https://goo.gl/LsjSGD or
>> https://gist.github.com/ned14/89ee39c6b8eb5254116a and it takes the
>> following form:
>>
>> struct flag : bitwise_flags<flag>
>> {
>> flag() = default;
>> constexpr flag(bitwise_flags<flag> v) noexcept :
>> bitwise_flags<flag>(v) { }
>> static constexpr auto none(){ return bit(0);}
>> static constexpr auto delete_on_close(){ return bit(1); }
>> static constexpr auto disable_safety_fsyncs(){ return bit(2); }
>> };
>
> What is the bit above? what is the decltype of bit(0)?
> Could flag store bit(5)?
Please Niall, could you answer to these questions?
Vicente
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk