Michael Gerz wrote:
Hi folks,
could somebody please tell me why this piece of code compiles:
bool const show_change = par.lookupChange(cur.pos()) !=
Change::UNCHANGED;
as we have this
class Change {
public:
/// the type of change
enum Type {
UNCHANGED, // no change
INSERTED, // new text
DELETED // deleted text
};
}
and this
/// look up change at given pos
Change const lookupChange(lyx::pos_type pos) const;
Since when is it allowed to compare an object with an enum???
I found it out by myself: The enum is a constructor argument, i.e., it
is converted into an object. Very ugly.
Michael