Root base class in C++

前端 未结 7 1538
逝去的感伤
逝去的感伤 2021-01-04 11:29

Every object in .NET inherits (directly or indirectly) from the common root base \"Object\". Is there such a common object root in C++? How do I pass any object to

7条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-04 12:02

    There is no common base class in C++. However, there are already libraries that allow you to call member functions as delegates. You can try using boost::function together with boost::bind or boost::lambda.

提交回复
热议问题