Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tenth step for Learning C++ Programming

Similar presentations


Presentation on theme: "Tenth step for Learning C++ Programming"— Presentation transcript:

1 Tenth step for Learning C++ Programming
Template Templates Specialization Type Inference Standard Template Library List Deque Iterator Map

2 Both forms are identical
Template Declaration General form of Template declaration: template <class identifier> class_definition; or template <typename identifier> class_definition; Both forms are identical In the class definition identifier is some form of placeholder that can be used at positions, where we expect some type specification 11/2014

3 [ practice 1 Templates Specialization ]

4 [ explain 1 Templates Specialization ]

5 [ practice 2 Type Inference ]

6 [ explain 2 Type Inference ]

7 [ practice 3 Template, Auto & Decltype ]

8 [ explain 3 Template, Auto & Decltype ]

9 Sequence Container Overview
Library Name Description Example <vector> A dynamic array STL-vector.cpp <list> randomly changing sequence of items STL-list.cpp <stack> A sequence of items with pop and push at one end only (LIFO) - <queue> A Sequence of items with pop and push at opposite ends (FIFO) <deque> Double Ended Queue with pop and push at both ends STL-deque.cpp

10 [ practice 4 Standard Template Library, List ]

11 [ explain 4 Standard Template Library, List ]

12 [ practice 5 Standard Template Library, Deque ]

13 [ explain 5 Standard Template Library, Deque ]

14 [ practice 6 Standard Template Library, Iterator ]

15 [ explain 6 Standard Template Library, Iterator ]

16 Associative Container Overview
Library Name Description Example <set> An unordered collection of items - <map> An collection of pairs of items indexed by the first one STL-map.cpp <bitset> A subset of a fixed and small set of items (The class provides something like an array of bits / optimizing for space allocation )

17 [ practice 7 Standard Template Library, Map ]

18 [ explain 7 Standard Template Library, Map ]

19


Download ppt "Tenth step for Learning C++ Programming"

Similar presentations


Ads by Google