Ticket #2887: patchfile.patch
File patchfile.patch, 1.7 KB (added by , 14 years ago) |
---|
-
detail/pass_through_engine.hpp
32 32 typedef typename helper_type::value_type base_type; 33 33 typedef typename base_type::result_type result_type; 34 34 35 explicit pass_through_engine(UniformRandomNumberGenerator rng) 36 // make argument an rvalue to avoid matching Generator& constructor 37 : _rng(static_cast<typename helper_type::rvalue_type>(rng)) 38 { } 35 explicit pass_through_engine(UniformRandomNumberGenerator rng): _rng(rng) { } 39 36 40 37 result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (base().min)(); } 41 38 result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (base().max)(); } -
mersenne_twister.hpp
28 28 #include <boost/detail/workaround.hpp> 29 29 #include <boost/random/detail/config.hpp> 30 30 #include <boost/random/detail/ptr_helper.hpp> 31 #include <boost/utility/enable_if.hpp> 32 #include <boost/type_traits/is_same.hpp> 31 33 32 34 namespace boost { 33 35 namespace random { … … 65 67 template<class It> mersenne_twister(It& first, It last) { seed(first,last); } 66 68 67 69 template<class Generator> 68 explicit mersenne_twister(Generator & gen) { seed(gen); }70 explicit mersenne_twister(Generator & gen, typename disable_if< is_same<Generator,mersenne_twister>,int >::type = 0) { seed(gen); } 69 71 72 70 73 // compiler-generated copy ctor and assignment operator are fine 71 74 72 75 void seed() { seed(UIntType(5489)); }