This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] P0935R0 Eradicating unnecessarily explicit default constructors


On 12/06/18 20:10 +0100, Jonathan Wakely wrote:
Explicit default constructors are problematic, so this change removes
them from <random> and <ext/random>, as per P0935R0.

	* include/bits/random.h (linear_congruential_engine)
	(mersenne_twister_engine, subtract_with_carry_engine, random_device)

I forgot to remove the default argument in the no-/dev/urandom version
of std::random_device. Fixed like so.

(Incidentally, it makes me very sad that our std::random_device is
5000 bytes even when it only needs to store a pointer, because we have
a union with mt19937 in it).


commit 8c359baec670ed7d0305d376ebf8ebb209e50a8a
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jun 15 17:10:06 2018 +0100

    PR libstdc++/86168 fix ambiguous default constructor
    
            PR libstdc++/86168
            * include/bits/random.h (random_device(const string&)): Remove
            default argument.

diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h
index 738c62fccd1..e59c8b0221d 100644
--- a/libstdc++-v3/include/bits/random.h
+++ b/libstdc++-v3/include/bits/random.h
@@ -1614,7 +1614,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     random_device() { _M_init("mt19937"); }
 
     explicit
-    random_device(const std::string& __token = "mt19937")
+    random_device(const std::string& __token)
     { _M_init_pretr1(__token); }
 #endif
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]