Reflection in C++

后端 未结 8 1848
失恋的感觉
失恋的感觉 2021-02-05 19:55

I\'ve been working for years with Java. During those years, I\'ve made extensive (or maybe just frequent) use of reflection, and found it useful and enjoyable. But 8 months ago

8条回答
  •  长发绾君心
    2021-02-05 20:05

    What do you need to do in C++, and what platform are you working with? I know of one way to get the complete class definitions and invoke functions using this data, it works in Windows but I don't know about other platforms. The idea is to take data from the DLL or exe export table. It's not easy - it took us several months work to get a decent implementation - but it will do everything that reflection-supporting languages do.

提交回复
热议问题