Is there a way to check whether the object is const?

Hi,
I am trying to overload a function with const object. In the sense, If the object calling is const I will const version and if not the normal function.

For example,
List l;
l.func(); // will call normal version
const List &l1(l);
l1.func(); // will call the other version

Is there a way to check whether the current object is const?

Thanks
er... I don't understand the question?

The object is const if you used the const keyword when declaring it.

In a member function, it's const if the function is const.
Topic archived. No new replies allowed.