Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63240 - trunk/boost/random
From: steven_at_[hidden]
Date: 2010-06-22 11:30:00


Author: steven_watanabe
Date: 2010-06-22 11:29:59 EDT (Tue, 22 Jun 2010)
New Revision: 63240
URL: http://svn.boost.org/trac/boost/changeset/63240

Log:
Fix vc71 errors, take 2.
Text files modified:
   trunk/boost/random/binomial_distribution.hpp | 13 +++++++++----
   trunk/boost/random/discrete_distribution.hpp | 13 +++++++++----
   trunk/boost/random/linear_congruential.hpp | 21 +++++++++++++--------
   trunk/boost/random/poisson_distribution.hpp | 13 +++++++++----
   4 files changed, 40 insertions(+), 20 deletions(-)

Modified: trunk/boost/random/binomial_distribution.hpp
==============================================================================
--- trunk/boost/random/binomial_distribution.hpp (original)
+++ trunk/boost/random/binomial_distribution.hpp 2010-06-22 11:29:59 EDT (Tue, 22 Jun 2010)
@@ -215,10 +215,7 @@
     friend std::basic_istream<CharT,Traits>&
     operator>>(std::basic_istream<CharT,Traits>& is, binomial_distribution& bd)
     {
- typename binomial_distribution::param_type parm;
- if(is >> parm) {
- bd.param(parm);
- }
+ bd.read(is);
         return is;
     }
 #endif
@@ -242,6 +239,14 @@
 
     /// @cond
 
+ template<class CharT, class Traits>
+ void read(std::basic_istream<CharT, Traits>& is) {
+ param_type parm;
+ if(is >> parm) {
+ param(parm);
+ }
+ }
+
     bool use_inversion() const
     {
         // BTRD is safe when np >= 10

Modified: trunk/boost/random/discrete_distribution.hpp
==============================================================================
--- trunk/boost/random/discrete_distribution.hpp (original)
+++ trunk/boost/random/discrete_distribution.hpp 2010-06-22 11:29:59 EDT (Tue, 22 Jun 2010)
@@ -390,10 +390,7 @@
     friend std::basic_istream<CharT, Traits>&
     operator>>(std::basic_istream<CharT, Traits>& is, discrete_distribution& dd)
     {
- typename discrete_distribution::param_type parm;
- if(is >> parm) {
- dd.param(parm);
- }
+ dd.read(is);
         return is;
     }
 #endif
@@ -421,6 +418,14 @@
 
     /// @cond
 
+ template<class CharT, class Traits>
+ void read(std::basic_istream<CharT, Traits>& is) {
+ param_type parm;
+ if(is >> parm) {
+ param(parm);
+ }
+ }
+
     template<class Iter>
     void init(Iter first, Iter last, std::input_iterator_tag)
     {

Modified: trunk/boost/random/linear_congruential.hpp
==============================================================================
--- trunk/boost/random/linear_congruential.hpp (original)
+++ trunk/boost/random/linear_congruential.hpp 2010-06-22 11:29:59 EDT (Tue, 22 Jun 2010)
@@ -202,14 +202,7 @@
   operator>>(std::basic_istream<CharT,Traits>& is,
              linear_congruential& lcg)
   {
- typename linear_congruential::result_type x;
- if(is >> x) {
- if(x >= (lcg.min)() && x <= (lcg.max)()) {
- lcg._x = x;
- } else {
- is.setstate(std::ios_base::failbit);
- }
- }
+ lcg.read(is);
     return is;
   }
  
@@ -217,6 +210,18 @@
 #endif
 #endif
 
+ template<class CharT, class Traits>
+ void read(std::basic_istream<CharT, Traits>& is) {
+ IntType x;
+ if(is >> x) {
+ if(x >= (min)() && x <= (max)()) {
+ _x = x;
+ } else {
+ is.setstate(std::ios_base::failbit);
+ }
+ }
+ }
+
   IntType _x;
 };
 

Modified: trunk/boost/random/poisson_distribution.hpp
==============================================================================
--- trunk/boost/random/poisson_distribution.hpp (original)
+++ trunk/boost/random/poisson_distribution.hpp 2010-06-22 11:29:59 EDT (Tue, 22 Jun 2010)
@@ -203,10 +203,7 @@
     friend std::basic_istream<CharT,Traits>&
     operator>>(std::basic_istream<CharT,Traits>& is, poisson_distribution& pd)
     {
- typename poisson_distribution::param_type parm;
- if(is >> parm) {
- pd.param(parm);
- }
+ pd.read(is);
         return is;
     }
 #endif
@@ -230,6 +227,14 @@
 
     /// @cond
 
+ template<class CharT, class Traits>
+ void read(std::basic_istream<CharT, Traits>& is) {
+ param_type parm;
+ if(is >> parm) {
+ param(parm);
+ }
+ }
+
     bool use_inversion() const
     {
         return _mean < 10;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk