Commit 982b8443 by Gabriel Dos Reis Committed by Gabriel Dos Reis

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
parent 1e608388
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> 2000-11-08 Mark Mitchell <mark@codesourcery.com>
* include/bits/codecvt.h (codecvt::do_out): Make it const-correct. * include/bits/codecvt.h (codecvt::do_out): Make it const-correct.
......
...@@ -49,28 +49,28 @@ namespace std ...@@ -49,28 +49,28 @@ namespace std
unsigned int _Mask = (~0u >> _Shift) > unsigned int _Mask = (~0u >> _Shift) >
struct _Count_ones; 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> template<unsigned int _Num, unsigned int _Mask>
struct _Count_ones<_Num, 0, _Mask> struct _Count_ones<_Num, 0, _Mask>
{ static const unsigned int _S_count = _Num; }; {
enum
template<unsigned int _Num, unsigned int _Mask> {
const unsigned int _Count_ones<_Num, 0, _Mask>::_S_count; _S_count = _Num
};
};
template<unsigned int _Num, int _Shift, unsigned int _Mask> template<unsigned int _Num, int _Shift, unsigned int _Mask>
struct _Count_ones struct _Count_ones
{ {
static const unsigned int _S_halfcount = enum
_Count_ones<_Num, _Shift/2, (_Mask^((~_Mask)>>(_Shift/2))) >::_S_count; {
static const unsigned int _S_count _S_halfcount = _Count_ones<_Num, _Shift/2,
= (_S_halfcount&_Mask) + ((_S_halfcount>>_Shift)&_Mask); (_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 // 22.1.1 Locale
template<typename _Tp> class allocator; template<typename _Tp> class allocator;
template<typename _Tp, typename _Alloc> class vector; template<typename _Tp, typename _Alloc> class vector;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment