I would like to inherit from a class with the const
specifier like this:
class Property
{
int get() const;
void set(int a);
};
class Co
You can use a template class and a specialization for a constant type:
template class base_property {
protected:
T value;
};
template class property : public base_property {
public:
const T& get()const { return value; }
void set(const T& v){ value = v; }
};
template class property : public base_property {
public:
const T& get()const { return value; }
};
class ConstChild : public property{ };