From fc4e723570b975fe94733b72b068ee332b345790 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 21 Feb 2018 15:29:16 +0000 Subject: [PATCH] Don't overload but cast --- Random_numbers/include/CGAL/Random.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Random_numbers/include/CGAL/Random.h b/Random_numbers/include/CGAL/Random.h index a64fd18cd3f..8300912f6e2 100644 --- a/Random_numbers/include/CGAL/Random.h +++ b/Random_numbers/include/CGAL/Random.h @@ -90,21 +90,15 @@ public: uniform_smallint(IntType lower, IntType upper) { // uniform_smallint has a closed interval, CGAL a halfopen - boost::uniform_smallint dist(lower,upper-1); - boost::variate_generator > generator(rng,dist); + typedef boost::rand48::result_type result_type; + boost::uniform_smallint dist(static_cast(lower), + static_cast(upper-1)); + boost::variate_generator > generator(rng,dist); return generator(); } - // Overload to avoid a warning with VC++ - inline - std::size_t - uniform_smallint(std::size_t lower, std::size_t upper) - { - return uniform_smallint(static_cast(lower), - static_cast(upper)); - } - + template IntType uniform_smallint(IntType lower)