consolidate all repos to one for archive
This commit is contained in:
22
semester_2/programiranje_2/naloga0902/main.cpp
Normal file
22
semester_2/programiranje_2/naloga0902/main.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <iostream>
|
||||
#include "SmartPointer.h"
|
||||
#include "Date.h"
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello, World!\n\n";
|
||||
|
||||
SmartPointer<Date> date1(new Date(6, 5, 2020));
|
||||
{
|
||||
SmartPointer<Date> date2 = date1;
|
||||
}
|
||||
std::cout << date1->toString() << std::endl;
|
||||
|
||||
|
||||
SmartPointer<Date> date2(new Date(1, 1, 2019));
|
||||
date2 = date1 = date1 = date1 = date1 = date1;
|
||||
date2 = date2;
|
||||
date2 = date2;
|
||||
std::cout << "reference count: " << date2.useCount() << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user