当前位置:网站首页>Inline built-in function
Inline built-in function
2022-07-05 04:34:00 【On the bald Road】
How to write it : It can be declared and defined in full inline You can also write only when declaring .
purpose : Before calling this function inline The information of informs the compiling system , The compilation system will handle function calls as built-in functions . If you call many times or have requirements for call efficiency, you can declare to ask the built-in function ;
Be careful !: The built-in function declaration only suggests the system , Not instructions .
Only simple functions with small scale and frequent calls are applicable .
Example :
#include<iostream>
using namespace std;
inline int max(int, int, int);
int main() {
int a = max(5, 6, 9);
cout << a;
return 0;
}
int max(int a, int b, int c) {
int maxword = a;
if (a < b) {
maxword = b;
}
if (maxword < c) {
maxword = c;
}
return maxword;
}
边栏推荐
- 【虚幻引擎UE】实现背景模糊下近景旋转操作物体的方法及踩坑记录
- Convert Boolean to integer value PHP - Convert Boolean to integer value PHP
- English topic assignment (26)
- QT Bluetooth: a class for searching Bluetooth devices -- qbluetooth devicediscoveryagent
- Introduction to RT thread kernel (5) -- memory management
- What are the building energy-saving software
- CSDN body auto generate directory
- Scheduling system of kubernetes cluster
- Live broadcast preview | container service ack elasticity prediction best practice
- Neural networks and deep learning Chapter 3: linear model reading questions
猜你喜欢
Network security - record web vulnerability fixes
概率论与数理统计考试重点复习路线
Sword finger offer 04 Search in two-dimensional array
可观测|时序数据降采样在Prometheus实践复盘
防护电路中的元器件
WeNet:面向工业落地的E2E语音识别工具
Mxnet imports various libcudarts * so、 libcuda*. So not found
托管式服务网络:云原生时代的应用体系架构进化
Discussion on the dimension of confrontation subspace
【虚幻引擎UE】实现UE5像素流部署仅需六步操作少走弯路!(4.26和4.27原理类似)
随机推荐
The remainder operation is a hash function
介绍汉明距离及计算示例
包 类 包的作用域
Chapter 6 text processing tools for shell programming (awk)
Basic analysis of IIC SPI protocol
Introduction to RT thread kernel (4) -- clock management
电源管理总线 (PMBus)
Hexadecimal to octal
Reading and visualization of DICOM, MHD and raw files in medical imaging
Here comes the Lantern Festival red envelope!
About the prompt loading after appscan is opened: guilogic, it keeps loading and gets stuck. My personal solution. (it may be the first solution available in the whole network at present)
MacBook安装postgreSQL+postgis
Bit operation skills
Introduction to RT thread kernel (5) -- memory management
[crampon programming] lintcode decoding Encyclopedia - 1100 strange printer
NetSetMan pro (IP fast switching tool) official Chinese version v5.1.0 | computer IP switching software download
【FineBI】使用FineBI制作自定义地图过程
【虚幻引擎UE】打包报错出现!FindPin错误的解决办法
[crampon game] MC tutorial - first day of survival
Interview related high-frequency algorithm test site 3