aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/tr1/random
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2006-10-17 11:56:21 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2006-10-17 11:56:21 +0000
commit46db415941fcc2edcfdb7d9de4480484ce28b76f (patch)
tree85502d16217ebc971d63c61ffa4e0143fa5ed212 /libstdc++-v3/include/tr1/random
parente4fd3c844119075907e31d9f0179e7be661dbe95 (diff)
downloadgcc-46db415941fcc2edcfdb7d9de4480484ce28b76f.zip
gcc-46db415941fcc2edcfdb7d9de4480484ce28b76f.tar.gz
gcc-46db415941fcc2edcfdb7d9de4480484ce28b76f.tar.bz2
re PR libstdc++/28514 (libstdc++ vs. anonymous namespaces)
2006-10-17 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/28514 * include/bits/cpp_type_traits.h (__detail): Uglify namespace. * include/ext/rope: Remove global-scope anonymous namespace, use nested __detail. Fixup resulting formatting issues. * include/ext/ropeimpl.h: Same. * include/tr1/hashtable_policy.h: Remove anonymous namespace nesting for __detail. * include/tr1/random: Revert anonymous namespace to nested __detail namespace. * include/tr1/random.tcc: Same. * src/ext-inst.cc: Fixups for above. From-SVN: r117824
Diffstat (limited to 'libstdc++-v3/include/tr1/random')
-rw-r--r--libstdc++-v3/include/tr1/random19
1 files changed, 6 insertions, 13 deletions
diff --git a/libstdc++-v3/include/tr1/random b/libstdc++-v3/include/tr1/random
index 543378e..9d1aa84 100644
--- a/libstdc++-v3/include/tr1/random
+++ b/libstdc++-v3/include/tr1/random
@@ -62,7 +62,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
/*
* Implementation-space details.
*/
- namespace
+ namespace __detail
{
template<typename _UIntType, int __w,
bool = __w < std::numeric_limits<_UIntType>::digits>
@@ -85,7 +85,6 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
typedef __gnu_cxx::__conditional_type<(sizeof(unsigned) == 4),
unsigned, unsigned long>::__type _UInt32Type;
- } // anonymous namespace
/*
* An adaptor class for converting the output of any Generator into
@@ -158,7 +157,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
/ result_type(_M_g.max() - _M_g.min());
return __return_value;
}
-
+ } // namespace __detail
/**
* Produces random numbers on a given disribution function using a un uniform
@@ -176,7 +175,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
public:
typedef _Engine engine_type;
- typedef _Adaptor<_Engine, _Dist> engine_value_type;
+ typedef __detail::_Adaptor<_Engine, _Dist> engine_value_type;
typedef _Dist distribution_type;
typedef typename _Dist::result_type result_type;
@@ -184,7 +183,6 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
typedef typename __gnu_cxx::__enable_if<
is_arithmetic<result_type>::value, result_type>::__type _IsValidType;
- public:
/**
* Constructs a variate generator with the uniform random number
* generator @p __eng for the random distribution @p __dist.
@@ -360,7 +358,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
*/
result_type
min() const
- { return (__mod<_UIntType, 1, 0, __m>(__c) == 0) ? 1 : 0; }
+ { return (__detail::__mod<_UIntType, 1, 0, __m>(__c) == 0) ? 1 : 0; }
/**
* Gets the largest possible value in the output range.
@@ -448,7 +446,6 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
void
seed(_Gen& __g, false_type);
- private:
_UIntType _M_x;
};
@@ -542,7 +539,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
result_type
max() const
- { return _Shift<_UIntType, __w>::__value - 1; }
+ { return __detail::_Shift<_UIntType, __w>::__value - 1; }
result_type
operator()();
@@ -625,7 +622,6 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
void
seed(_Gen& __g, false_type);
- private:
_UIntType _M_x[state_size];
int _M_p;
};
@@ -682,7 +678,6 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
static const int long_lag = __r;
static const int short_lag = __s;
- public:
/**
* Constructs a default-initialized % subtract_with_carry random number
* generator.
@@ -826,7 +821,6 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
void
seed(_Gen& __g, false_type);
- private:
typedef typename __gnu_cxx::__add_unsigned<_IntType>::__type _UIntType;
_UIntType _M_x[long_lag];
@@ -857,7 +851,6 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
static const int long_lag = __r;
static const int short_lag = __s;
- public:
/**
* Constructs a default-initialized % subtract_with_carry_01 random
* number generator.
@@ -1011,12 +1004,12 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
void
seed(_Gen& __g, false_type);
- private:
void
_M_initialize_npows();
static const int __n = (__w + 31) / 32;
+ typedef __detail::_UInt32Type _UInt32Type;
_UInt32Type _M_x[long_lag][__n];
_RealType _M_npows[__n];
_UInt32Type _M_carry;