Add containers module with initial implementation and integrate into CMake build system.

This commit is contained in:
2026-02-21 10:38:58 +01:00
parent 90fbcc38dc
commit 939e98d5b2
16 changed files with 272 additions and 12 deletions
+30
View File
@@ -2,6 +2,36 @@
#include <iostream>
ClassA::ClassA() : IComparable(), _number(0), _pDecimal(new float(0.0f)) {
std::cout << "ClassA()" << std::endl;
// _pDecimal = new float(0.0f);
}
ClassA::ClassA(const ClassA &other) :
IComparable(),
_number(other._number),
_pDecimal(new float(*other._pDecimal)) {
std::cout << "ClassA(const ClassA &other)" << std::endl;
// // for presentation only
// // shallow copy
// _number = other._number;
// *_pDecimal = *other._pDecimal;
//
// // deep copy
// _number = other._number;
// _pDecimal = new float(*other._pDecimal);
}
ClassA::~ClassA() {
std::cout << "~ClassA()" << std::endl;
delete _pDecimal;
_pDecimal = nullptr;
}
void ClassA::Print() {
std::cout << "ClassA" << std::endl;
}