diff options
author | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2006-07-28 04:57:34 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2006-07-28 04:57:34 +0000 |
commit | b82f782bfb5c4383ac0bc1e37271ab3bbeb9304d (patch) | |
tree | 81547eb1eadbf4669dec412581227155f1ad5c83 /libstdc++-v3/include/tr1/random | |
parent | 85661c41dd4fe35a4fd54c3679b94fa0ea2e902a (diff) | |
download | gcc-b82f782bfb5c4383ac0bc1e37271ab3bbeb9304d.zip gcc-b82f782bfb5c4383ac0bc1e37271ab3bbeb9304d.tar.gz gcc-b82f782bfb5c4383ac0bc1e37271ab3bbeb9304d.tar.bz2 |
PR libstdc++/19664 round 3
2006-07-27 Benjamin Kosnik <bkoz@wells.artheist.org>
PR libstdc++/19664 round 3
* include/Makefile.am (tr1_headers): Add hashtable_policy.h.
* include/Makefile.in: Regenerate.
* include/tr1/hashtable: Move policy classes into...
* include/tr1/hashtable_policy.h: ... this. New.
* src/globals_locale.cc: Move contents....
* src/locale_init.cc: ... to here, put in anonymous namespace.
* src/Makefile.am: Remove globals_locale.cc.
* src/Makefile.in: Regenerate.
* src/locale.cc: Convert __gnu_internal to anonymous namespace.
* src/debug.cc: Same.
* src/ext-inst.cc: Same.
* src/mt_allocator.cc: Same.
* src/pool_allocator.cc: Same.
* include/tr1/random: Convert std::tr1::_Private to anonymous
namespace.
* include/tr1/random.tcc: Same.
* include/tr1/hashtable: Move ::Internal to std::tr1::detail and
enclose bits that can actually be internal in in anonymous
namespace.
* include/tr1/unordered_set: Adjust explicit qualifications for
namespace changes.
* include/tr1/unordered_map: Same.
* include/tr1/cmath: Convert __gnu_internal to nested detail namespace.
* include/bits/cpp_type_traits.h: Move __type_type into anonymous
namespace.
* include/ext/rope: Change _Rope_constants to anonymous namespace.
* include/ext/ropeimpl.h: Same.
* src/ext-inst.cc: Same.
From-SVN: r115790
Diffstat (limited to 'libstdc++-v3/include/tr1/random')
-rw-r--r-- | libstdc++-v3/include/tr1/random | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/libstdc++-v3/include/tr1/random b/libstdc++-v3/include/tr1/random index 01ada8b..92a71af 100644 --- a/libstdc++-v3/include/tr1/random +++ b/libstdc++-v3/include/tr1/random @@ -61,7 +61,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) /* * Implementation-space details. */ - namespace _Private + namespace { // Type selectors -- are these already implemented elsewhere? template<bool, typename _TpTrue, typename _TpFalse> @@ -76,6 +76,16 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) typedef _TpFalse _Type; }; + template<typename _UIntType, int __w, bool = + __w < std::numeric_limits<_UIntType>::digits> + struct _Shift + { static const _UIntType __value = 0; }; + + template<typename _UIntType, int __w> + struct _Shift<_UIntType, __w, true> + { static const _UIntType __value = _UIntType(1) << __w; }; + } // anonymous namespace + /* * An adaptor class for converting the output of any Generator into * the input for a specific Distribution. @@ -124,17 +134,6 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) return __return_value; } - template<typename _UIntType, int __w, bool = - __w < std::numeric_limits<_UIntType>::digits> - struct _Shift - { static const _UIntType __value = 0; }; - - template<typename _UIntType, int __w> - struct _Shift<_UIntType, __w, true> - { static const _UIntType __value = _UIntType(1) << __w; }; - - } // namespace std::tr1::_Private - /** * Produces random numbers on a given disribution function using a un uniform @@ -152,7 +151,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) public: typedef _Engine engine_type; - typedef _Private::_Adaptor<_Engine, _Dist> engine_value_type; + typedef _Adaptor<_Engine, _Dist> engine_value_type; typedef _Dist distribution_type; typedef typename _Dist::result_type result_type; @@ -364,8 +363,8 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) operator()(); /** - * Compares two linear congruential random number generator objects of the - * same type for equality. + * Compares two linear congruential random number generator + * objects of the same type for equality. * * @param __lhs A linear congruential random number generator object. * @param __rhs Another linear congruential random number generator obj. @@ -378,8 +377,8 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) { return __lhs._M_x == __rhs._M_x; } /** - * Compares two linear congruential random number generator objects of the - * same type for inequality. + * Compares two linear congruential random number generator + * objects of the same type for inequality. * * @param __lhs A linear congruential random number generator object. * @param __rhs Another linear congruential random number generator obj. @@ -553,7 +552,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) result_type max() const - { return _Private::_Shift<_UIntType, __w>::__value - 1; } + { return _Shift<_UIntType, __w>::__value - 1; } result_type operator()(); @@ -1116,8 +1115,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) public: /** The type of the generated random value. */ - typedef typename _Private::_Select< - (sizeof(_Result_type1) > sizeof(_Result_type2)), + typedef typename _Select<(sizeof(_Result_type1) > sizeof(_Result_type2)), _Result_type1, _Result_type2>::_Type result_type; // parameter values |