From: Arnaud Giersch Date: Thu, 6 Feb 2020 15:59:41 +0000 (+0100) Subject: Add "explicit". X-Git-Tag: v3.26~1007 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/feb4b0363e1d0ab17462d21f646d92c5ee946671 Add "explicit". --- diff --git a/include/xbt/random.hpp b/include/xbt/random.hpp index 8175c69ac5..26492e2ad6 100644 --- a/include/xbt/random.hpp +++ b/include/xbt/random.hpp @@ -25,7 +25,7 @@ public: /** @brief Build a new random number generator with default seed */ Random() = default; /** @brief Build a new random number generator with given seed */ - Random(int seed) : mt19937_gen(seed) {} + explicit Random(int seed) : mt19937_gen(seed) {} virtual ~Random() = default; @@ -73,7 +73,7 @@ public: class XBT_PUBLIC StdRandom : public Random { public: StdRandom() = default; - StdRandom(int seed) : Random(seed) {} + explicit StdRandom(int seed) : Random(seed) {} int uniform_int(int min, int max) override; double uniform_real(double min, double max) override; @@ -88,7 +88,7 @@ public: class XBT_PUBLIC XbtRandom : public Random { public: XbtRandom() = default; - XbtRandom(int seed) : Random(seed) {} + explicit XbtRandom(int seed) : Random(seed) {} int uniform_int(int min, int max) override; double uniform_real(double min, double max) override;