C++ Templates | Template Classes | Implementing Stack ADT

Publicado el: 19 marzo 2022
en el canal de: 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!


En esta página del sitio puede ver el video en línea C++ Templates | Template Classes | Implementing Stack ADT de Duración hora minuto segunda en buena calidad , que subió el usuario PhyMac Illustrator 19 marzo 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,293 veces y le gustó 14 a los espectadores. Disfruta viendo!