C++ Templates | Template Classes | Implementing Stack ADT

Published: 19 March 2022
on channel: PhyMac Illustrator
1,293
14

Hey everyone,

This video teaches how to implement class templates, more specifically you will learn to implement Stack ADT for any type.

Implementing class templates might be tricky if you don't know how templates work and what it takes to instantiate a template within a particular translation unit.

If you are trying to instantiate a particular function or class inside a translation unit then the full definition of the template must be visible inside that translation unit otherwise you might get linker errors.

It is not possible to separate the interface and its implementation when using templates but it is possible when you already know which types could be used and you can instantiate them explicitly in another translation unit ahead of their use.

In this video:
01:11 Abstract interface of stack ADT
01:37 What is Stack ADT?
03:01 C++ Stack ADT Class Interface
03:06 Header guard
05:09 Why Peek() function should be const in C++?
05:50 Why class template definitions should be in the header?
07:38 Implementing Push(), Pop() and Peek() functions
09:47 Dynamic Memory Allocation
10:56 Auto resize implementation
16:38 Traversing through the stack elements

Link to the C++ templates playlist:    • C++ Templates  
Compilation with GCC:    • How to work with GCC | Compilation process...  
Working with Command Line:    • Working with Command - Line | Cmd | Cygwin...  
C++ Fundamentals:    • C++ Fundamentals  

Me on the internet
----------------------------------------------------------
Github: https://github.com/ravi688

Thank you for watching!


On this page of the site you can watch the video online C++ Templates | Template Classes | Implementing Stack ADT with a duration of hours minute second in good quality, which was uploaded by the user PhyMac Illustrator 19 March 2022, share the link with friends and acquaintances, this video has already been watched 1,293 times on youtube and it was liked by 14 viewers. Enjoy your viewing!