[copy]static_cast, dynamic_cast, safe_cast

来源:互联网 发布:sql计算时间间隔小时 编辑:程序博客网 时间:2024/06/13 21:39

static_cast: includes no run-time checking, so is fast and potentially dangerous.

dynamic_cast: includes run-time checking, so is slow and safe. Returns a null pointer if the cast fails.

safe_cast: same as dynamic cast, but throws an exception if the cast fails.

原创粉丝点击