3 ms·
The struct vec takes a template parameter T, and it's constructor takes a different template parameter U. Therefore, you must specify both template directives w
by sclangdon 11y ago
The struct vec takes a template parameter T, and it's constructor takes a different template parameter U. Therefore, you must specify both template directives when defining the constructor; one for the class type, and one for the constructor's argument.
- jahnu 11y agoEdit: re-wording this reply. I guess what surprised me is I would almost expect it to look something like this... template <> vec<3,int> ::vec(template <> const vec<3,float> &v) : x(int(v.x+.5f)),y(int(v.y+.5f)),z(int(v.z+.5f)) {} I can tell that is silly but still.