Avoiding dynamic_cast/RTTI

前端 未结 6 769
执笔经年
执笔经年 2020-12-16 23:13

I was recently working on a piece of C++ code for a side project (the cpp-markdown library, for the curious), and ran into a coding question that I\'d like some opinions on.

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-17 00:01

    If you know the conversion can't be invalid then just use static_cast.

提交回复
热议问题