How to pass a function pointer that points to constructor?

前端 未结 7 1975
陌清茗
陌清茗 2020-11-29 06:45

I\'m working on implementing a reflection mechanism in C++. All objects within my code are a subclass of Object(my own generic type) that contain a static member datum of ty

7条回答
  •  粉色の甜心
    2020-11-29 06:52

    Hmm, odd. create is a member variable i.e. only available in class instances but the intent of it seems to be creating an instance in the first place.

    You cannot take the address of a constructor, but you can create static factory methods of your own and take the address of that.

提交回复
热议问题