localefwd.h (_Count_ones<>::_S_halfcount, [...]): Turn into enumerators.
* include/bits/localefwd.h (_Count_ones<>::_S_halfcount, _Count_ones<>::_S_count): Turn into enumerators. From-SVN: r37372
This commit is contained in:
parent
1e60838877
commit
982b8443e8
@ -1,3 +1,8 @@
|
||||
2000-11-10 Gabriel Dos Reis <gdr@codesourcery.com>
|
||||
|
||||
* include/bits/localefwd.h (_Count_ones<>::_S_halfcount,
|
||||
_Count_ones<>::_S_count): Turn into enumerators.
|
||||
|
||||
2000-11-08 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* include/bits/codecvt.h (codecvt::do_out): Make it const-correct.
|
||||
|
@ -49,28 +49,28 @@ namespace std
|
||||
unsigned int _Mask = (~0u >> _Shift) >
|
||||
struct _Count_ones;
|
||||
|
||||
// It is preferable to use enumerators instead of integral static data
|
||||
// members to avoid emission of superflous variables -- gdr.
|
||||
template<unsigned int _Num, unsigned int _Mask>
|
||||
struct _Count_ones<_Num, 0, _Mask>
|
||||
{ static const unsigned int _S_count = _Num; };
|
||||
|
||||
template<unsigned int _Num, unsigned int _Mask>
|
||||
const unsigned int _Count_ones<_Num, 0, _Mask>::_S_count;
|
||||
{
|
||||
enum
|
||||
{
|
||||
_S_count = _Num
|
||||
};
|
||||
};
|
||||
|
||||
template<unsigned int _Num, int _Shift, unsigned int _Mask>
|
||||
struct _Count_ones
|
||||
{
|
||||
static const unsigned int _S_halfcount =
|
||||
_Count_ones<_Num, _Shift/2, (_Mask^((~_Mask)>>(_Shift/2))) >::_S_count;
|
||||
static const unsigned int _S_count
|
||||
= (_S_halfcount&_Mask) + ((_S_halfcount>>_Shift)&_Mask);
|
||||
enum
|
||||
{
|
||||
_S_halfcount = _Count_ones<_Num, _Shift/2,
|
||||
(_Mask^((~_Mask)>>(_Shift/2))) >::_S_count,
|
||||
_S_count = (_S_halfcount&_Mask) + ((_S_halfcount>>_Shift)&_Mask)
|
||||
};
|
||||
};
|
||||
|
||||
template<unsigned int _Num, int _Shift, unsigned int _Mask>
|
||||
const unsigned int _Count_ones<_Num, _Shift, _Mask>::_S_count;
|
||||
|
||||
template<unsigned int _Num, int _Shift, unsigned int _Mask>
|
||||
const unsigned int _Count_ones<_Num, _Shift, _Mask>::_S_halfcount;
|
||||
|
||||
// 22.1.1 Locale
|
||||
template<typename _Tp> class allocator;
|
||||
template<typename _Tp, typename _Alloc> class vector;
|
||||
|
Loading…
Reference in New Issue
Block a user