diff --git a/include/xo/randomgen/uniformgen.hpp b/include/xo/randomgen/uniformgen.hpp index d1c4d62..28e311c 100644 --- a/include/xo/randomgen/uniformgen.hpp +++ b/include/xo/randomgen/uniformgen.hpp @@ -12,11 +12,19 @@ namespace xo { public: using generator_type = generator>; - template - static generator_type unit(Engine eng) { + /* named ctor idiom */ + template + static generator_type unit(Eng eng) { return make_generator(std::move(eng), std::uniform_real_distribution(0.0, 1.0)); } + + /* named ctor idiom */ + template + static generator_type interval(Eng eng, double lo, double hi) { + return make_generator(std::move(eng), + std::uniform_real_distribution(lo, hi)); + } }; } /*namespace rng*/ } /*namespace xo*/