When is using 'typeid' the best solution?

后端 未结 6 423
没有蜡笔的小新
没有蜡笔的小新 2021-01-01 10:16

There are many reasons not to use typeid. Other than for using members of type_info (implementation defined behavior), it is usually (always?) pos

6条回答
  •  一生所求
    2021-01-01 10:47

    When implementing multimethods (or multiple dispatch), where the actual call is chosen from e.g. a map, using std::type_info* as a key.

提交回复
热议问题