assert: use feature test for static_cast

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>