首页 | 本学科首页   官方微博 | 高级检索  
     检索      

VC++中函数返回对象值的优化实现方式
引用本文:梁茂盛.VC++中函数返回对象值的优化实现方式[J].西南民族学院学报(自然科学版),2005,31(1):152-155.
作者姓名:梁茂盛
作者单位:广东惠州学院计算机系办公室 广东惠州
摘    要:C 的函数在返回一个非引用类型的值时,一般会将被返回的变量通过复制的方式传递到调用它的上层代码的变量中;但在Visual C 中,当一个函数采用非引用方式返回一个对象时,编译器在一定的条件下会进行编译优化,减少或避免对象在内存中的复制操作,提高程序的运行效率。

关 键 词:Visual  C++  返回对象  编译优化
文章编号:1003-2843(2005)01-0152-04
修稿时间:2004年10月20

Compiling optimization in VC++ function returning an object value
LIANG Mao-sheng.Compiling optimization in VC++ function returning an object value[J].Journal of Southwest Nationalities College(Natural Science Edition),2005,31(1):152-155.
Authors:LIANG Mao-sheng
Abstract:In most cases, when a C++ function returns a value without using reference technology, the value is passed to the calling level variable by copying in memory. However, in Visual C++ and under certain conditions, the compiler will optimize a function returning an object value without using reference technology. The optimization can reduce or avoid copying of the object, so the executing efficiency of the program gets improved.
Keywords:Visual C++  returning an object value  compiling optimization  
本文献已被 CNKI 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号