Let's take uniform_int_distribution
for example. In my opinion, despite the fact that it stores a default set of distribution parameters, it is practically stateless. As such, wouldn't it be better and more convenient to design it as a function template like
template <class Engine, class IntType = int>
IntType uniform_int(Engine& engine, IntType a = 0, IntType b = numeric_limits<IntType>::max());
Quite often, I find myself write something like
std::uniform_int_distribution<int> uniform_int(a, b);
... = uniform_int(engine);
Or to compress it into a single line
... = std::uniform_int_distribution<int>(a, b)(engine);
Either way, this feels contrived and awkward. With a function interface, this can be done naturally as
... = std::uniform_int(engine, a, b);
You can still store a default set of distribution parameters if you like
auto my_uniform_int = std::bind(std::uniform_int<int>, placeholders::_1, a, b);
Am I missing something?