public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-4518] libstdc++: Rename _UniformRandomNumberGenerator parameters
@ 2020-10-29  9:09 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2020-10-29  9:09 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:68990ed13dc36cb98f94afa84e9dadc39e955e8c

commit r11-4518-g68990ed13dc36cb98f94afa84e9dadc39e955e8c
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Oct 29 09:09:44 2020 +0000

    libstdc++: Rename _UniformRandomNumberGenerator parameters
    
    The paper P0346R1 renamed uniform random number generators to
    uniform random bit generators, to describe their purpose more
    accurately. This makes that same change in one of the relevant
    files (but not the others).
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/uniform_int_dist.h (uniform_int_distribution):
            Rename _UniformRandomNumberGenerator template parameters to
            _UniformRandomBitGenerator, as per P0346R1.

Diff:
---
 libstdc++-v3/include/bits/uniform_int_dist.h | 48 +++++++++++++---------------
 1 file changed, 22 insertions(+), 26 deletions(-)

diff --git a/libstdc++-v3/include/bits/uniform_int_dist.h b/libstdc++-v3/include/bits/uniform_int_dist.h
index ecb8574864a..cf6ba35c675 100644
--- a/libstdc++-v3/include/bits/uniform_int_dist.h
+++ b/libstdc++-v3/include/bits/uniform_int_dist.h
@@ -184,35 +184,35 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       /**
        * @brief Generating functions.
        */
-      template<typename _UniformRandomNumberGenerator>
+      template<typename _UniformRandomBitGenerator>
 	result_type
-	operator()(_UniformRandomNumberGenerator& __urng)
+	operator()(_UniformRandomBitGenerator& __urng)
         { return this->operator()(__urng, _M_param); }
 
-      template<typename _UniformRandomNumberGenerator>
+      template<typename _UniformRandomBitGenerator>
 	result_type
-	operator()(_UniformRandomNumberGenerator& __urng,
+	operator()(_UniformRandomBitGenerator& __urng,
 		   const param_type& __p);
 
       template<typename _ForwardIterator,
-	       typename _UniformRandomNumberGenerator>
+	       typename _UniformRandomBitGenerator>
 	void
 	__generate(_ForwardIterator __f, _ForwardIterator __t,
-		   _UniformRandomNumberGenerator& __urng)
+		   _UniformRandomBitGenerator& __urng)
 	{ this->__generate(__f, __t, __urng, _M_param); }
 
       template<typename _ForwardIterator,
-	       typename _UniformRandomNumberGenerator>
+	       typename _UniformRandomBitGenerator>
 	void
 	__generate(_ForwardIterator __f, _ForwardIterator __t,
-		   _UniformRandomNumberGenerator& __urng,
+		   _UniformRandomBitGenerator& __urng,
 		   const param_type& __p)
 	{ this->__generate_impl(__f, __t, __urng, __p); }
 
-      template<typename _UniformRandomNumberGenerator>
+      template<typename _UniformRandomBitGenerator>
 	void
 	__generate(result_type* __f, result_type* __t,
-		   _UniformRandomNumberGenerator& __urng,
+		   _UniformRandomBitGenerator& __urng,
 		   const param_type& __p)
 	{ this->__generate_impl(__f, __t, __urng, __p); }
 
@@ -227,10 +227,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
     private:
       template<typename _ForwardIterator,
-	       typename _UniformRandomNumberGenerator>
+	       typename _UniformRandomBitGenerator>
 	void
 	__generate_impl(_ForwardIterator __f, _ForwardIterator __t,
-			_UniformRandomNumberGenerator& __urng,
+			_UniformRandomBitGenerator& __urng,
 			const param_type& __p);
 
       param_type _M_param;
@@ -265,17 +265,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 
   template<typename _IntType>
-    template<typename _UniformRandomNumberGenerator>
+    template<typename _UniformRandomBitGenerator>
       typename uniform_int_distribution<_IntType>::result_type
       uniform_int_distribution<_IntType>::
-      operator()(_UniformRandomNumberGenerator& __urng,
+      operator()(_UniformRandomBitGenerator& __urng,
 		 const param_type& __param)
       {
-	typedef typename _UniformRandomNumberGenerator::result_type
-	  _Gresult_type;
-	typedef typename std::make_unsigned<result_type>::type __utype;
-	typedef typename std::common_type<_Gresult_type, __utype>::type
-	  __uctype;
+	typedef typename _UniformRandomBitGenerator::result_type _Gresult_type;
+	typedef typename make_unsigned<result_type>::type __utype;
+	typedef typename common_type<_Gresult_type, __utype>::type __uctype;
 
 	const __uctype __urngmin = __urng.min();
 	const __uctype __urngmax = __urng.max();
@@ -351,19 +349,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _IntType>
     template<typename _ForwardIterator,
-	     typename _UniformRandomNumberGenerator>
+	     typename _UniformRandomBitGenerator>
       void
       uniform_int_distribution<_IntType>::
       __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
-		      _UniformRandomNumberGenerator& __urng,
+		      _UniformRandomBitGenerator& __urng,
 		      const param_type& __param)
       {
 	__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
-	typedef typename _UniformRandomNumberGenerator::result_type
-	  _Gresult_type;
-	typedef typename std::make_unsigned<result_type>::type __utype;
-	typedef typename std::common_type<_Gresult_type, __utype>::type
-	  __uctype;
+	typedef typename _UniformRandomBitGenerator::result_type _Gresult_type;
+	typedef typename make_unsigned<result_type>::type __utype;
+	typedef typename common_type<_Gresult_type, __utype>::type __uctype;
 
 	const __uctype __urngmin = __urng.min();
 	const __uctype __urngmax = __urng.max();


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-29  9:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29  9:09 [gcc r11-4518] libstdc++: Rename _UniformRandomNumberGenerator parameters Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).