Functions

In this chapter we discuss the essentials of function declarations, prototypes, and signatures; overloading functions; function call resolution; default/optional arguments; temporary variables and when they're created; reference parameters and return values; and inline functions.

5.1

Function Declarations

106

5.2

Overloading Functions

107

5.3

Optional Arguments

109

5.4

Operator Overloading

111

5.5

Parameter Passing by Value

116

5.6

Parameter Passing by Reference

118

5.7

References to const

121

5.8

Function Return Values

122

5.9

Returning References from Functions

122

5.10

Overloading on const-ness

124

5.11

Inline Functions

126

5.12

Inlining versus Macro Expansion

127

Категории