base class optimization and const