diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 55ca9e044a42c5f3b1592c95d9b2bba0cf0f1fe3..3558c0a892e56f4e96d45ca464c8d6a08c04555a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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. diff --git a/libstdc++-v3/include/bits/localefwd.h b/libstdc++-v3/include/bits/localefwd.h index e57321ae2a363e0b0d93d2a22758f56c0da2984c..73dba99788dbdf49b8598c60436b63e97a32266b 100644 --- a/libstdc++-v3/include/bits/localefwd.h +++ b/libstdc++-v3/include/bits/localefwd.h @@ -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;