From ffcdb79bb6eb1139c399881fcb1aee0ba03e1d6b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 15 Feb 2018 13:54:30 +0000 Subject: [PATCH] Random_numbers: Add overload for unifoem_smallint --- Random_numbers/include/CGAL/Random.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Random_numbers/include/CGAL/Random.h b/Random_numbers/include/CGAL/Random.h index 955fb881c59..798b26422b7 100644 --- a/Random_numbers/include/CGAL/Random.h +++ b/Random_numbers/include/CGAL/Random.h @@ -84,6 +84,7 @@ public: } + template IntType uniform_smallint(IntType lower, IntType upper) @@ -95,6 +96,16 @@ public: return generator(); } + // Overload to avoid a warning with VC++ + template <> + 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)