To add const to a non-const object, which is the prefered method? const_cast or static_cast. In a recent question, s
const
const_cast
static_cast
I'd say static_cast is preferable since it will only allow you to cast from non-const to const (which is safe), and not in the other direction (which is not necessarily safe).