Use const_cast rather than force type transformation.