using static_cast<int> to get rid of an interesting (rarely seen) warning: enumeral and non-enumeral type in conditional expression