I am trying to figure out to call a template specialization function from another. In the following short segment, I am trying to call the BLACK specific function from the RED. I get the following compiler error
cannot call member function ‘bool noClass<color>::_open() [with Colors color = (Colors)2]’ without object
which makes perfect sense. How can (or can I) make the call to the BLACK from RED work? The code segment is below from the noClass C++ header.
#ifndef COLORS_H
#define COLORS_H
enum class Colors { RED, GREEN, BLACK };
#endif /* COLORS_H */
#ifndef NOCLASS_H
#define NOCLASS_H
template <Colors color>
class noClass {
public: bool Open ( );
protected: bool _open ( );
};