Introduction to OOP: Chapter 3: Classes and Methods: [next] [previous] [audio] [real] [text]

C++ Inline definitions

Often many functions have very small function bodies - these can be declared as inline and placed directly into the interface file, instead of the implementation file.

class Card {
	...
	int rank () { return r; }
};

OR

inline int Card::rank ()
{
	return r;
}
Intro OOP, Chapter 3, Slide 25