C++ Virtual Template METHOD
I am stucked in a situation where a class needs to get some parameters that are templates, but this class is NOT a template class, and is a base class that can (must) be derived. The issue I am facing is that C++ does not allow virtual template methods. The Material class CANNOT be a template class : only its method. The Material::send method MUST contains the template parameter. The Material class is a base class that is derived (by PhongMaterial) and only the derived class are used. Another class, Actor, uses the Material as a protected member, and needs to call this template function. The Material method is called, and not the PhongMaterial. How can I get around this issue ? Here's a MCE : https://www.sololearn.com/compiler-playground/c8SlPrm4zJoR