cpp:class_templates_specialization

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
cpp:class_templates_specialization [2020/05/18 15:36]
gthanos [Εξειδίκευση της κλάσης Box στην περίπτωση που η παράμετρος είναι δείτης σε χαρακτήρα]
cpp:class_templates_specialization [2021/06/04 17:47]
gthanos
Line 8: Line 8:
 #ifndef _BOXTPTR_HPP_ #ifndef _BOXTPTR_HPP_
 #define _BOXTPTR_HPP_ #define _BOXTPTR_HPP_
 +
 #include "Box.hpp" #include "Box.hpp"
 +
 template<typename T> template<typename T>
 class Box<T*> { class Box<T*> {
Line 79: Line 81:
 Παρακάτω παρατίθεται κώδικας ο οποίος χρησιμοποιεί την παραπάνω εξειδίκευση του //template// Παρακάτω παρατίθεται κώδικας ο οποίος χρησιμοποιεί την παραπάνω εξειδίκευση του //template//
  
-<code cpp BoxPtrUsage.hpp>+<code cpp BoxPtrUsage.cpp>
 #include <iostream> #include <iostream>
 #include "BoxPtr.hpp" #include "BoxPtr.hpp"
Line 121: Line 123:
 #ifndef _BOXCHARPTR_HPP_ #ifndef _BOXCHARPTR_HPP_
 #define _BOXCHARPTR_HPP_ #define _BOXCHARPTR_HPP_
 +
 +#include "Box.hpp"
 +
 template <> template <>
 class Box<char *> { class Box<char *> {
Line 181: Line 186:
 <code cpp BoxCharPtrUsage.cpp> <code cpp BoxCharPtrUsage.cpp>
 #include <iostream> #include <iostream>
-#include "Box.hpp"+
 #include "Student.hpp" #include "Student.hpp"
 +#include "BoxCharPtr.hpp"
  
 using namespace std; using namespace std;
cpp/class_templates_specialization.txt · Last modified: 2022/05/26 10:47 by gthanos