I have the following class definition:
class image {
public:
template <class T> image(int w, int h);
virtual ~image();
void clear();
};
template <class T> image::image(int w, int h) {
...
...
}
The constructor is defined in the same header file. Now, how do I instantiate an object of this class?
I tried this
image a<float>(128, 128);
but got the following error
error: expected initializer before '<' token
image a<float>(128, 128);
How do I do this?