Original Post
I have a struct as such:
template<typename C>
struct gen_element
{
template<typename T> gen_element (T C::*v) {}
operator VertexArray::Format::Element () {
return element;
}
VertexArray::Format::Element element;
};
I can't figure out how to specialise the constructor, I'm not even sure that it's possible. The best I could think of was
template<typename C> gen_element<C> ::
template<> gen_element<float> (float C::*v)
{
return VertexArray::Format::Element(VertexArray::Format::FLOAT, 1, (int) v);
}
but that doesn't work. What I I want to do is
template<typename C, typename T>
VertexArray::Format::Element gen_element (T C::*v);
template<typename C>
VertexArray::Format::Element gen_element<float> (float C::*v)
{
return VertexArray::Format::Element(VertexArray::Format::FLOAT, 1, (int) v);
}
but my compiler doesn't like partial specialisations of functions. It is right to complain?