I am just learning about Template Template class specialisation. Not a big problem to explain in detail. From my understanding std::uniform_int_distribution
is a template whereas std::uniform_int_distribution<Type>
is the full specialisation of uniform_int_distribution
giving a type. I pass this in the specialisation class template as follows below
Main class
template <template <class> class Distribution,
class Type,
class Engine = std::mt19937>
class random_gen
{
....
}
specialization of class
template <class Type, class Engine>
class random_gen<std::uniform_real_distribution<Type>, Type, Engine>
{
...
}
the error that occurs is:
type/value mismatch at argument 1 in template parameter list for 'template<template<class> class Distribution, class Type, class Engine> class random_gen'
The specialization still needs to be a template template argument. You passed in a full type. You want:
Just
std::uniform_real_distribution
, notstd::uniform_distribution<Type>
.