The keyword inline is used as part of a function declaration as a request to the compiler to inline the function body. - Codeprg

Breaking

programing News Travel Computer Engineering Science Blogging Earning

Thursday, 4 June 2020

The keyword inline is used as part of a function declaration as a request to the compiler to inline the function body.

Thankful, Thanks, Grateful, Thank You, Message

The keyword inline is used as part of a function declaration as a request to the compiler to inline the function body. As such it should be used instead of the old-style #define macros. It is implicit for a member function defined within a class. These typically are short functions where efficiency is paramount. inline bool one_less(int a, int b) { return (a – b == 1);}

 Inline functions are normally defined in header files, because definitions of an inline function must be identical. Sophisticated use of the keyword inline is to encapsulate code within a namespace. See, http://en.cppreference.com/w/cpp/language/namespace,

C is a programming language designed by Dennis Ritchie of Bell Laboratories and implemented there on a PDP-11 in 1972. It was used as the systems implementation language to implement the UNIX operating system. In 1978, “The C Programming Language” by Brian Kernighan and Dennis Ritchie was published. This became the first de facto standard for the language. In 1988 they published the second edition based on the Draft-proposed ANSI C standard. This standard was approved in 1989 ( C89). This largely remains the version of the C programming language that is used by professional programmers. 

The International Standards Organization (ISO) has also adopted C99 and C2011 with further improvements and extensions to C89. C++ is a programming language designed by Bjarne Stroustrup of Bell Laboratories and commercially released in 1985. In 1986, “The C++ Programming Language” by Bjarne Stroustrup was published. As with K&R, this book defined the initial de facto standard. C++ was an object-oriented extension to C that kept most of the basic C features and semantics. 


Indeed its implementation was as a preprocessor to existing C compilers. Its key insight was to allow the C struct to encapsulate both data and functions with added key words for data hiding, and to add resource handlers called constructors and destructors. In 1998 , ISO adopted a first standard. This class emphasizes the IS0 C++11 standard. There is also an ISO C++14 and a scheduled ISO C++17. “The C++ Programming Language:4th edition” by Bjarne Stroustrup is a critical guide to the use of C++11