O'Reilly logo

An Introduction to Design Patterns in C++ with Qt 4 by Paul Ezust, Alan Ezust

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. 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

Function Declarations

Functions in C++ are very similar to functions and subroutines in other ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required