If you
doStuff (const T)
this is not the same type as
doStuff (const Param &)
The first is a constant, regardless of the fact that T in this case has a permanent link to T, which really does not make sense, since the links cannot be restored. In the future, this is a link to const Param
.
What you can do is change
struct Bar : public Foo<Param&>
to
struct Bar : public Foo<Param>
and then
virtual void doStuff (const T) const = 0;
to
virtual void doStuff (const T&) const = 0;
source share