h**o 发帖数: 347 | | q*****g 发帖数: 72 | 2 don't do this, use polymorphism instead.
if you really want to do this, use RTTI, such as typeid operator.
【在 h**o 的大作中提到】 : 并以此写switch
| h**o 发帖数: 347 | 3 i see, i should try avoid being lazy...
【在 q*****g 的大作中提到】 : don't do this, use polymorphism instead. : if you really want to do this, use RTTI, such as typeid operator.
| q*****g 发帖数: 72 | 4 it seems to me that it has nothing to do with laziness.
【在 h**o 的大作中提到】 : i see, i should try avoid being lazy...
| N********n 发帖数: 8363 | 5 try visitor pattern
【在 h**o 的大作中提到】 : 并以此写switch
|
|