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!
In questa pagina del sito puoi guardare il video online C++ Templates | Template Classes | Implementing Stack ADT della durata di ore minuti seconda in buona qualità , che l'utente ha caricato PhyMac Illustrator 19 marzo 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,293 volte e gli è piaciuto 14 spettatori. Buona visione!