In the following code:
template <class COORD>
class Foo
{
public:
void setCoordinate( const COORD& coord ) { m_Coordinate = coord; }
const COORD& getCoordinate() const { return m_Coordinate; }
/* ... other methods ... */
private:
COORD m_Coordinate;
/* ... other data ... */
};
If I were to instantiate the class with the following code:
Foo<void> foo;
I would be forming a reference to "void", which would throw a compiler error.
Is there a way to completely omit the methods "setCoordinate" and "getCoordinate" as well as the data member "m_Coordinate" in the specific case where the template parameter COORD is void?
The class "Foo" still works without those methods in place, it's just more limited.