Template alias as template specialisation not recognized.

Paul paultjeadriaanse at gmail.com
Sat Jan 16 01:21:24 UTC 2021


I'm having issues when trying to use a template alias as a 
template specialisation.
When using the following:
> alias Vec(uint size, Type) = Mat!(size, 1, Type);

> void setUniform(V : Vec!(L, bool), int L)(string name, V value) 
> {...}

> Vec!(4, bool) a;
> setUniform("test", a);

I get the following error:
> template `shader.Shader.setUniform` cannot deduce function from 
> argument types `!()(string, Mat!(4u, 1u, bool))`, candidates 
> are:DUB
shader.d(43, 7): `setUniform(V : Vec!(L, bool), uint L)(string 
name, V value)`

Meanwhile, when using the following, I have no issues:
> void setUniform(V : Mat!(L, 1, bool), int L)(string name, V 
> value) {}


More information about the Digitalmars-d-learn mailing list