如何为此编写getter函数? [英] how to write getter function for this?

查看:73
本文介绍了如何为此编写getter函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在这个帮助器类中有一些数据:

Hi,

I''ve a some data in this helper class called:

protected:
CChartPointsArray<T> m_vPoints;



我需要从另一个类访问此数据.如何编写"getter"函数以获取数据?我不应该从受保护"更改为公开".

还是有其他方法可以在不从受保护"更改为公开"的情况下获取数据?

< T>是一个结构



I need to access this data from another class. How do i write the "getter" function to get the data? I am not supposed to changed from "protected" to "public".

Or is there any other way to get the data without changing from "protected" to "public"?

<T>is a struct

推荐答案

尝试建立一个朋友类或函数来访问数据goto [ http://msdn.microsoft.com/en-us/library/h2x4fzdz.aspx [
Try making a friend class or function to access the data goto this[^] link.

http://msdn.microsoft.com/en-us/library/h2x4fzdz.aspx[^]


这篇关于如何为此编写getter函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆