摘要:
字面量 字面量是指源码中,固定的常量。比如, const char* p = "abcd"; const std::string s = "efg"; const int v = 10; const double d = 20.1; const unsigned long l = 123465789 阅读全文
摘要:
返回值优化(Return Value Optimization, 简称RVO)是通过对源代码进行转换、消除对象的创建来实现加速程序,提升程序性能的优化措施,通常是由编译器实现的优化。 按值返回 假设我们打算实现Complex类,用于实现复数。可以这样设计Complex类: class Complex 阅读全文