static_cast to fix compile on linux