C++ wrapper around uniform mt19937 SequenceContainer With the following interface in mind

EasyRandom&lt;unsigned int&gt; prng(a, b);
auto x = prng();   // scalar
auto v = prng(10); // vector


I wrote the following class:

// https://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution
template &lt;typename T = unsigned int&gt;
class EasyRandom
{
private:
  std::random_device rd;
  std::unique_ptr&lt;std::mt19937&gt; gen;
  std::unique_ptr&lt;std::uniform_int_distribution&lt;T&gt;&gt; dist;

public:
  EasyRandom(T a, T b)
  {
    gen = std::make_unique&lt;std::mt19937&gt;(rd());
    dist = std::make_unique&lt;std::uniform_int_distribution&lt;T&gt;&gt;(a, b);
  }

  T operator()() { return (*dist)(*gen); }

  std::vector&lt;T&gt; operator()(size_t n)
  {
    std::vector&lt;T&gt; v;
    for (; n &gt; 0; v.push_back(operator()()), --n);
    return v;
  }
};


I also have a few specific questions:


Is there a way to instantiate EasyRandom without the use of pointers?
Is it possible to change operator()(size_t n) to return any user-specified SequenceContainer (e.g. vector, list, deque) instead of hard-coding it to a particular implementation (e.g. std::vector)?
gen and dist don't need to be pointers.  Just declare them as members, and use the member initializer list in the constructor to initialize them.

std::random_device rd;
std::mt19937 gen;
std::uniform_int_distribution&lt;T&gt; dist;

EasyRandom(T a, T b): gen(rd()), dist(a, b) {
}


In the operator() that returns a vector, you can reserve space for the vector to avoid memory reallocations during the insertions (v.reserve(n)).  While not an issue with ints, if you use emplace_back rather than push_back that can avoid potential extra copies of a value for non-simple types.

The second question is off topic (code not implemented).