use template form of sfinae
IPR; use const_cast_from instead of static casts