Re: [Boost-bugs] [Boost C++ Libraries] #10364: Release 1.56 broke random::uniform_real_distribution

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10364: Release 1.56 broke random::uniform_real_distribution
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-02-16 13:20:40


#10364: Release 1.56 broke random::uniform_real_distribution
-------------------------------+---------------------------
  Reporter: mouse008@… | Owner: no-maintainer
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: random
   Version: Boost 1.56.0 | Severity: Regression
Resolution: | Keywords:
-------------------------------+---------------------------

Comment (by Mouse <mouse008@…>):

 It still doesn't look fully fixed:

 {{{
 #include <iostream>
 #include <boost/multiprecision/gmp.hpp>
 #include <boost/multiprecision/random.hpp>

 using namespace boost::multiprecision;
 using namespace boost::random;

 int main() {

         unsigned long long myseed = 0x12345670;
         mt19937 rgen(myseed);
         independent_bits_engine<mt19937, 100, mpf_float_50> gen3(rgen);
         uniform_real_distribution<mpf_float_50> ur(-20.0, 20.0);

         std::cout << std::hex
         // << std::showbase
         ;

         //
         // Generate some values:
         //
         std::cout << std::setprecision(50);
         for(unsigned i = 0; i < 20; ++i)
                 std::cout << std::setw(2) << (i+1) << ": "
                           << std::setw(20)
                           << ur(gen3) << " "
                           << ur(rgen)
                           << std::endl;
         std::cout << std::endl;
 }
 }}}


 {{{
 $ clang++ -o b-r6b -I ~/src/boost_1_60_0/include -I/opt/local/include
 b-r6b.cpp -L ~/src/boost_1_60_0/lib -lboost_system -lboost_filesystem
 -lboost_random -L/opt/local/lib -lgmp -lrdrand
 In file included from b-r6b.cpp:3:
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/random.hpp:12:10:
 warning:
       NOTE: Use of this header (boost/multiprecision/random.hpp) is
 deprecated:
       please use the random number library headers directly. [-W#pragma-
 messages]
 # pragma message("NOTE: Use of this header
 (boost/multiprecision/random.hpp...
          ^
 In file included from b-r6b.cpp:3:
 In file included from
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/random.hpp:16:
 In file included from
 /Users/uri/src/boost_1_60_0/include/boost/random.hpp:38:
 /Users/uri/src/boost_1_60_0/include/boost/random/independent_bits.hpp:167:20:
 error:
       invalid operands to binary expression ('result_type' (aka
 'boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on>') and
 'std::size_t'
       (aka 'unsigned long'))
             S = (S << w0) + (u & y0_mask);
                  ~ ^ ~~
 /Users/uri/src/boost_1_60_0/include/boost/random/uniform_real_distribution.hpp:40:48:
 note:
       in instantiation of member function
 'boost::random::independent_bits_engine<boost::random::mersenne_twister_engine<unsigned
       int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640,
 15,
       4022730752, 18, 1812433253>, 100,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on>
>::operator()'
       requested here
         result_type numerator = static_cast<T>(eng() - (eng.min)());
                                                ^
 /Users/uri/src/boost_1_60_0/include/boost/random/uniform_real_distribution.hpp:72:12:
 note:
       in instantiation of function template specialization
 'boost::random::detail::generate_uniform_real<boost::random::independent_bits_engine<boost::random::mersenne_twister_engine<unsigned
       int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640,
 15,
       4022730752, 18, 1812433253>, 100,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on> >,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on> >'
 requested here
     return generate_uniform_real(eng, min_value, max_value,
            ^
 /Users/uri/src/boost_1_60_0/include/boost/random/uniform_real_distribution.hpp:193:22:
 note:
       in instantiation of function template specialization
 'boost::random::detail::generate_uniform_real<boost::random::independent_bits_engine<boost::random::mersenne_twister_engine<unsigned
       int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640,
 15,
       4022730752, 18, 1812433253>, 100,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on> >,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on> >'
 requested here
     { return detail::generate_uniform_real(eng, _min, _max); }
                      ^
 b-r6b.cpp:26:11: note: in instantiation of function template
 specialization
 'boost::random::uniform_real_distribution<boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on>
>::operator()<boost::random::independent_bits_engine<boost::random::mersenne_twister_engine<unsigned
       int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640,
 15,
       4022730752, 18, 1812433253>, 100,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on> > >'
 requested here
                           << ur(gen3) << " "
                                ^
 /Users/uri/src/boost_1_60_0/include/boost/optional/optional.hpp:1274:1:
 note:
       candidate template ignored: could not match 'basic_ostream' against
 'number'
 operator<<(std::basic_ostream<CharType, CharTrait>& os,
 optional_detail::opt...
 ^
 /Users/uri/src/boost_1_60_0/include/boost/smart_ptr/shared_ptr.hpp:897:64:
 note:
       candidate template ignored: could not match 'basic_ostream' against
 'number'
 template<class E, class T, class Y> std::basic_ostream<E, T> & operator<<
 (s...
                                                                ^
 /Users/uri/src/boost_1_60_0/include/boost/format/format_class.hpp:118:9:
 note:
       candidate template ignored: could not match 'basic_ostream' against
 'number'
         operator<<( std::basic_ostream<Ch2, Tr2> & ,
         ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/detail/no_et_ops.hpp:274:4:
 note:
       candidate template ignored: could not match 0 against 1
    operator << (const number<B, et_off>& a, const I& b)
    ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/detail/et_ops.hpp:599:4:
 note:
       candidate template ignored: substitution failure [with B =
       boost::multiprecision::backends::gmp_float<50>, I = unsigned long]:
 no type
       named 'type' in 'boost::enable_if_c<false,
 boost::multiprecision::detail::expression<boost::multiprecision::detail::shift_left,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on>, unsigned
 long,
       void, void> >'
    operator << (const number<B, et_on>& a, const I& b)
    ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/detail/et_ops.hpp:606:7:
 note:
       candidate template ignored: could not match 'expression' against
 'number'
       operator << (const detail::expression<tag, Arg1, Arg2, Arg3, Arg4>&
 a...
       ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/number.hpp:1685:22:
 note:
       candidate template ignored: could not match 'number<type-
 parameter-0-0,
       ExpressionTemplates>' against 'unsigned long'
 inline std::ostream& operator << (std::ostream& os, const number<Backend,
 Ex...
                      ^
 In file included from b-r6b.cpp:3:
 In file included from
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/random.hpp:16:
 In file included from
 /Users/uri/src/boost_1_60_0/include/boost/random.hpp:38:
 /Users/uri/src/boost_1_60_0/include/boost/random/independent_bits.hpp:174:20:
 error:
       invalid operands to binary expression ('result_type' (aka
 'boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on>') and
       'unsigned long')
             S = (S << (w0 + 1)) + (u & y1_mask);
                  ~ ^ ~~~~~~~~
 /Users/uri/src/boost_1_60_0/include/boost/optional/optional.hpp:1274:1:
 note:
       candidate template ignored: could not match 'basic_ostream' against
 'number'
 operator<<(std::basic_ostream<CharType, CharTrait>& os,
 optional_detail::opt...
 ^
 /Users/uri/src/boost_1_60_0/include/boost/smart_ptr/shared_ptr.hpp:897:64:
 note:
       candidate template ignored: could not match 'basic_ostream' against
 'number'
 template<class E, class T, class Y> std::basic_ostream<E, T> & operator<<
 (s...
                                                                ^
 /Users/uri/src/boost_1_60_0/include/boost/format/format_class.hpp:118:9:
 note:
       candidate template ignored: could not match 'basic_ostream' against
 'number'
         operator<<( std::basic_ostream<Ch2, Tr2> & ,
         ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/detail/no_et_ops.hpp:274:4:
 note:
       candidate template ignored: could not match 0 against 1
    operator << (const number<B, et_off>& a, const I& b)
    ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/detail/et_ops.hpp:599:4:
 note:
       candidate template ignored: substitution failure [with B =
       boost::multiprecision::backends::gmp_float<50>, I = unsigned long]:
 no type
       named 'type' in 'boost::enable_if_c<false,
 boost::multiprecision::detail::expression<boost::multiprecision::detail::shift_left,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on>, unsigned
 long,
       void, void> >'
    operator << (const number<B, et_on>& a, const I& b)
    ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/detail/et_ops.hpp:606:7:
 note:
       candidate template ignored: could not match 'expression' against
 'number'
       operator << (const detail::expression<tag, Arg1, Arg2, Arg3, Arg4>&
 a...
       ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/number.hpp:1685:22:
 note:
       candidate template ignored: could not match 'number<type-
 parameter-0-0,
       ExpressionTemplates>' against 'unsigned long'
 inline std::ostream& operator << (std::ostream& os, const number<Backend,
 Ex...
                      ^
 In file included from b-r6b.cpp:3:
 In file included from
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/random.hpp:16:
 In file included from
 /Users/uri/src/boost_1_60_0/include/boost/random.hpp:38:
 /Users/uri/src/boost_1_60_0/include/boost/random/independent_bits.hpp:240:81:
 error:
       invalid operands to binary expression
 ('boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on>' and
       'unsigned long')
   ...< std::numeric_limits<UIntType>::digits ? UIntType((UIntType(1) << w)
 - 1) ...
                                                          ~~~~~~~~~~~ ^ ~
 /Users/uri/src/boost_1_60_0/include/boost/random/independent_bits.hpp:59:14:
 note:
       in instantiation of member function
 'boost::random::independent_bits_engine<boost::random::mersenne_twister_engine<unsigned
       int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640,
 15,
       4022730752, 18, 1812433253>, 100,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on>
>::max_imp'
       requested here
     { return max_imp(boost::is_integral<UIntType>()); }
              ^
 /Users/uri/src/boost_1_60_0/include/boost/random/uniform_real_distribution.hpp:41:51:
 note:
       in instantiation of member function
 'boost::random::independent_bits_engine<boost::random::mersenne_twister_engine<unsigned
       int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640,
 15,
       4022730752, 18, 1812433253>, 100,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on> >::max'
 requested
       here
         result_type divisor = static_cast<T>((eng.max)() - (eng.min)());
                                                   ^
 /Users/uri/src/boost_1_60_0/include/boost/random/uniform_real_distribution.hpp:72:12:
 note:
       in instantiation of function template specialization
 'boost::random::detail::generate_uniform_real<boost::random::independent_bits_engine<boost::random::mersenne_twister_engine<unsigned
       int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640,
 15,
       4022730752, 18, 1812433253>, 100,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on> >,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on> >'
 requested here
     return generate_uniform_real(eng, min_value, max_value,
            ^
 /Users/uri/src/boost_1_60_0/include/boost/random/uniform_real_distribution.hpp:193:22:
 note:
       in instantiation of function template specialization
 'boost::random::detail::generate_uniform_real<boost::random::independent_bits_engine<boost::random::mersenne_twister_engine<unsigned
       int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640,
 15,
       4022730752, 18, 1812433253>, 100,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on> >,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on> >'
 requested here
     { return detail::generate_uniform_real(eng, _min, _max); }
                      ^
 b-r6b.cpp:26:11: note: in instantiation of function template
 specialization
 'boost::random::uniform_real_distribution<boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on>
>::operator()<boost::random::independent_bits_engine<boost::random::mersenne_twister_engine<unsigned
       int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640,
 15,
       4022730752, 18, 1812433253>, 100,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on> > >'
 requested here
                           << ur(gen3) << " "
                                ^
 /Users/uri/src/boost_1_60_0/include/boost/optional/optional.hpp:1274:1:
 note:
       candidate template ignored: could not match 'basic_ostream' against
 'number'
 operator<<(std::basic_ostream<CharType, CharTrait>& os,
 optional_detail::opt...
 ^
 /Users/uri/src/boost_1_60_0/include/boost/smart_ptr/shared_ptr.hpp:897:64:
 note:
       candidate template ignored: could not match 'basic_ostream' against
 'number'
 template<class E, class T, class Y> std::basic_ostream<E, T> & operator<<
 (s...
                                                                ^
 /Users/uri/src/boost_1_60_0/include/boost/format/format_class.hpp:118:9:
 note:
       candidate template ignored: could not match 'basic_ostream' against
 'number'
         operator<<( std::basic_ostream<Ch2, Tr2> & ,
         ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/detail/no_et_ops.hpp:274:4:
 note:
       candidate template ignored: could not match 0 against 1
    operator << (const number<B, et_off>& a, const I& b)
    ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/detail/et_ops.hpp:599:4:
 note:
       candidate template ignored: substitution failure [with B =
       boost::multiprecision::backends::gmp_float<50>, I = unsigned long]:
 no type
       named 'type' in 'boost::enable_if_c<false,
 boost::multiprecision::detail::expression<boost::multiprecision::detail::shift_left,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_float<50>,
       boost::multiprecision::expression_template_option::et_on>, unsigned
 long,
       void, void> >'
    operator << (const number<B, et_on>& a, const I& b)
    ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/detail/et_ops.hpp:606:7:
 note:
       candidate template ignored: could not match 'expression' against
 'number'
       operator << (const detail::expression<tag, Arg1, Arg2, Arg3, Arg4>&
 a...
       ^
 /Users/uri/src/boost_1_60_0/include/boost/multiprecision/number.hpp:1685:22:
 note:
       candidate template ignored: could not match 'number<type-
 parameter-0-0,
       ExpressionTemplates>' against 'unsigned long'
 inline std::ostream& operator << (std::ostream& os, const number<Backend,
 Ex...
                      ^
 1 warning and 3 errors generated.
 $
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10364#comment:8>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC