
2 May
2011
2 May
'11
10:58 p.m.
What about: template < size_t _Nb, base = _Base_bitset < ((_Nb) < 1 ? 0 : ((_Nb) + numeric_limits<unsigned long>::digits - 1) / numeric_limits<unsigned long>::digits) >
class bitset : base { bitset(size_t n) : base(n) { } }; Something like this compiles for me on G++4.6.0. It has the disadvantage of changing the number and type of template parameters, but we accept that for things like enable_if. This has the advantage that the identifier 'base' is not inherited accidentally into class scopes where it is no longer correct. Which is something that always makes me uncomfortable with the "typedef ... this_type" technique. - Marsh