3.6 inline FUNCTIONS
Functions can be declared as inline. It is a request (not a directive) to complier to use (expand) function like a macro. It speeds up the execution of the programs. Compiler has the authority to ignore this request. In present day high-speed computers, this facility is not very important. What it means with respect to classes will be discussed later.
In early days of personal computers, clock speed was as small as 10 MHz. (Today a typical clock is 2.7 GHz, i.e. 2700 MHz.) Naturally, compiler writers (language designers) were always looking for speed-ups. When a function is called, computer is required to execute lot of extra instructions. We, as programmers, are unaware of them. If function is small, many extra instructions ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access