macro is typeless and execute faster than funtion ,becaus of the overhead of calling and returnning of function,but macro will increase the size of program due  to many time's substitution,as well as the side effect of macro  may cause unexpected res…
本文首发于个人博客https://kezunlin.me/post/65dc693d/,欢迎阅读最新内容! cpp macro like function to implement a performance profiler Guide macro expansions name ===> quote as strings "xxx" name, name ===> xxx a ## b ===> concatenate the preceding and foll…
source: apple ARMv6 Function Calling Conventions When functions (routines) call other functions (subroutines), they may need to pass arguments to them. The called subroutines access these arguments asparameters. Conversely, some subroutines pass a re…
How to create DB2user function easily by DB Query Analyzer 6.03 Ma Genfeng (Guangdong Unitoll Servicesincorporated, Guangzhou510300) Abstract  The latest version of DB QueryAnalyzer is 6.03 In DB Query Analyzer 6.03, without changing any Windows OS s…
https://lwn.net/Articles/691932/ https://gcc.gnu.org/wiki/FunctionMultiVersioning why multi-versioning This aim of this project is to make it really easy for the developer to specify multiple versions of a function, each catered to a specific target…
4.4 指向Member Function的指针 (Pointer-to-Member Functions) 取一个nonstatic data member的地址,得到的结果是该member在 class 布局中的byte位置(再加1),它是一个不完整的值,须要被绑定于某个 class object的地址上,才可以被存取. 取一个nonstatic member function的地址,假设该函数是nonvirtual,则得到的结果是它在内存中真正的地址.然而这个值也是不全然的,它也须要被绑定…
目录 前言 一.std::function的原理与接口 1.1 std::function是函数包装器 1.2 C++注重运行时效率 1.3 用函数指针实现多态 1.4 std::function的接口 二.std::function的实现 2.1 类型系统 2.1.1 异常类 2.1.2 数据存储 2.1.3 辅助类 2.1.4 内存管理基类 2.1.5 仿函数调用 2.1.6 接口定义 2.1.7 类型关系 2.2 方法的功能与实现 2.2.1 多态性的体现 2.2.2 本地函数对象 2.2…
boost::function to encapsulate function pointers. 1. function #include <boost/function.hpp> #include <iostream> #include <cstdlib> #include <cstring> int main() { boost::function<int(const char*)> f = std::atoi; std::cout <…
In C++, following function declarations cannot be overloaded. (1)Function declarations that differ only in the return type. For example, the following program fails in compilation. 1 #include<iostream> 2 int foo() 3 { 4 return 10; 5 } 6 7 char foo()…
原文: https://code.google.com/p/googlemock/wiki/V1_7_ForDummies 地址被墙了, 看起来费劲, 转载一份 Google C++ Mocking Framework for Dummies Updated Nov 21, 2013 by zhanyong...@gmail.com What Is Google C++ Mocking Framework? Why Google Mock? Getting Started A Case for…