Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67878 - in trunk: boost/random libs/random/test
From: steven_at_[hidden]
Date: 2011-01-09 15:11:09


Author: steven_watanabe
Date: 2011-01-09 15:11:07 EST (Sun, 09 Jan 2011)
New Revision: 67878
URL: http://svn.boost.org/trac/boost/changeset/67878

Log:
Fix piecewise_constant_distribution for C++0x.
Text files modified:
   trunk/boost/random/piecewise_constant_distribution.hpp | 12 ++++++------
   trunk/libs/random/test/test_piecewise_constant_distribution.cpp | 4 ++--
   2 files changed, 8 insertions(+), 8 deletions(-)

Modified: trunk/boost/random/piecewise_constant_distribution.hpp
==============================================================================
--- trunk/boost/random/piecewise_constant_distribution.hpp (original)
+++ trunk/boost/random/piecewise_constant_distribution.hpp 2011-01-09 15:11:07 EST (Sun, 09 Jan 2011)
@@ -93,9 +93,9 @@
          * distribution will produce values uniformly distributed
          * in the range [0, 1).
          */
- template<class F>
- param_type(const std::initializer_list<RealType>& il, F f)
- : _intervals(il)
+ template<class T, class F>
+ param_type(const std::initializer_list<T>& il, F f)
+ : _intervals(il.begin(), il.end())
         {
             if(_intervals.size() < 2) {
                 _intervals.clear();
@@ -282,9 +282,9 @@
      * distribution will produce values uniformly distributed
      * in the range [0, 1).
      */
- template<class F>
- piecewise_constant_distribution(std::initializer_list<RealType> il, F f)
- : _intervals(il)
+ template<class T, class F>
+ piecewise_constant_distribution(std::initializer_list<T> il, F f)
+ : _intervals(il.begin(), il.end())
     {
         if(_intervals.size() < 2) {
             _intervals.clear();

Modified: trunk/libs/random/test/test_piecewise_constant_distribution.cpp
==============================================================================
--- trunk/libs/random/test/test_piecewise_constant_distribution.cpp (original)
+++ trunk/libs/random/test/test_piecewise_constant_distribution.cpp 2011-01-09 15:11:07 EST (Sun, 09 Jan 2011)
@@ -113,8 +113,8 @@
         { 99, 103, 107, 111, 115 },
         gen()
     };
- CHECK_SEQUENCE(param_il.intervals(), list_of(99)(103)(107)(111)(115));
- CHECK_SEQUENCE(param_il.densities(), list_of(.03125)(.0625)(.03125)(.125));
+ CHECK_SEQUENCE(parm_il.intervals(), list_of(99)(103)(107)(111)(115));
+ CHECK_SEQUENCE(parm_il.densities(), list_of(.03125)(.0625)(.03125)(.125));
 #endif
 
     boost::random::piecewise_constant_distribution<>::param_type


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