How to get C++ object name in run time?

前端 未结 8 1192
失恋的感觉
失恋的感觉 2021-01-17 11:08

Can I get an object\'s name in run time (like getting an object\'s type via RTTI)? I want the object to be able to print its name.

8条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-17 11:54

    C++ doesn't really support reflection. However, a bit of googling produced a couple of alternate methods, I doubt you will find them useful though.

提交回复
热议问题