Use-cases for reflection

后端 未结 9 2166
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 20:34

Recently I was talking to a co-worker about C++ and lamented that there was no way to take a string with the name of a class field and extract the field with that name; in o

9条回答
  •  长情又很酷
    2020-12-08 21:12

    I've used reflection in C# when there was some internal or private method in the framework or a third party library that I wanted to access.

    (Disclaimer: It's not necessarily a best-practice because private and internal methods may be changed in later versions. But it worked for what I needed.)

提交回复
热议问题