Consider the following class representing an integer parameter with upper and lower limits:
class Parameter
{
protected:
int value;
int minval;
int maxval;
};
I have a list of Parameter objects. Sometimes, a Parameter's minval/maxval will be the value of another Parameter in the list. Other times, they will just be integer literals. From what I understand, I can make minval/maxval either a reference to another Paremeter's value, or an integer literal, but not both, because int& != int.
How can I get around this?