How to apply sizeof() operator to non-static class member methods?

前端 未结 4 1032
轮回少年
轮回少年 2021-01-25 11:00
struct MyClass {
  int foo () { return 0; }
};

unsigned int size = sizeof(MyClass::foo);  // obviously error

Can we apply sizeof() to mem

4条回答
  •  一个人的身影
    2021-01-25 11:24

    Wanted to know if we can at all find the sizeof() a member method.

    No, because the C++ language doesn't have such a concept. Or the size of any kind of function.

提交回复
热议问题