前言
在撰写一般函数指针与类成员函数指针的过程中,我不禁对于C++类的内存分配问题产生了好奇。为何类成员函数指针的赋值为
|
|
众所周知,在C/C++中,函数实质上为地址。对于类中的函数,为何在对指针赋值时,并不需要关注对象本身,而只是将类中的某个函数地址绑定到成员函数指针上呢?
这是否意味着,在类中 成员函数本身并不占用对象存储空间,而保存于类中。
得益于前辈们稳健的工作,我也省下了重复造轮子的功夫。
##
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true