首页> 外文期刊>C - C++ Users Journal >String Concatenation & Expression Templates
【24h】

String Concatenation & Expression Templates

机译:字符串连接和表达模板

获取原文
获取原文并翻译 | 示例

摘要

Concatenating text strings is a common task, but generally an expensive one because it involves dynamic (heap) memory allocation, copying, and deallocation. For instance, consider an example where a series of STL string objects hold fragments of text that need to be joined together and returned from a function. This perfectly legal implementation generates the result that is required, but what of its efficiency? To understand the performance of this, look at how the return expression is evaluated.
机译:串联文本字符串是一项常见任务,但通常很昂贵,因为它涉及动态(堆)内存分配,复制和释放。例如,考虑一个示例,其中一系列STL字符串对象包含需要连接在一起并从函数返回的文本片段。这种完全合法的实施可以产生所需的结果,但是其效率如何呢?要了解其性能,请看一下如何对return表达式求值。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号