Presentation is loading. Please wait.

Presentation is loading. Please wait.

Templates. Templates Example: Swap Template Mechanism.

Similar presentations


Presentation on theme: "Templates. Templates Example: Swap Template Mechanism."— Presentation transcript:

1

2 Templates

3 Example: Swap

4

5

6

7

8

9 Template Mechanism

10 Template Mechanism Comments

11 Template Use

12 Template Instantiation

13 Template Instantiation

14 Template Instantiation

15 General Form of Template

16 Example

17 Example Continued

18 Example Continued

19 Templates with multiple parameters

20 Templates with multiple parameters

21 Templates with multiple parameters

22 Class templates

23 What’s wrong with typedef?

24 Type-independent Container

25 General form of class template

26 Instantiating class templates

27 Rules for class templates

28 Templates with ordinary parameters

29 STL (Standard Template Library)

30 STL Containers

31 vectors

32 vector inefficiences

33 STL’s stack container

34 STL’s stack container

35 Example: convert base 10 to base 2

36 Example: convert base 10 to base 2

37 STL queue container

38 queue example

39 queue example

40 STL deque

41 STL deque<T> class template

42

43 STL algorithms

44

45 Supply own comparison operator

46


Download ppt "Templates. Templates Example: Swap Template Mechanism."

Similar presentations


Ads by Google