cpp:class_templates
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
cpp:class_templates [2020/05/18 15:33] – gthanos | cpp:class_templates [2020/05/25 07:50] – [Ένα πιο σύνθετο παράδειγμα] gthanos | ||
---|---|---|---|
Line 55: | Line 55: | ||
katherine.setName(" | katherine.setName(" | ||
| | ||
+ | cout << "--- Printing Values ---" << endl; | ||
cout << kate << endl; | cout << kate << endl; | ||
cout << katherine << endl; | cout << katherine << endl; | ||
cout << studentBox.get() << endl; | cout << studentBox.get() << endl; | ||
+ | cout << "--- Destroying objects ---" << endl; | ||
} | } | ||
</ | </ | ||
Line 79: | Line 81: | ||
public: | public: | ||
Array(); | Array(); | ||
- | Array(const T t[], int length); | ||
Array(const Array< | Array(const Array< | ||
void set(T e, int index); | void set(T e, int index); | ||
Line 93: | Line 94: | ||
Array< | Array< | ||
// empty | // empty | ||
- | } | ||
- | |||
- | template< | ||
- | Array< | ||
- | int copy_size = length > size ? size : length; | ||
- | for(int i=0; i< | ||
- | array[i] = t[i]; | ||
} | } | ||
cpp/class_templates.txt · Last modified: 2020/05/25 06:52 (external edit)