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!
Auf dieser Seite können Sie das Online-Video C++ Templates | Template Classes | Implementing Stack ADT mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer PhyMac Illustrator 19 März 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,293 Mal angesehen und es wurde von 14 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!