#include "svector.h" template SVector::SVector(size_t reserve, T initValue) : array(reserve, initValue) { init(); } template SVector::SVector(bool needInit) { isInit = needInit; } template SVector::SVector(size_t reserve) : array(reserve) { init(); } template std::shared_ptr SVector::operator[](size_t pos) const { if (!isInit || array.size() <= pos) return {}; return array[pos]; } template void SVector::push_back(T &&value) { isInit = true; array.push_back(std::shared_ptr(value)); } template void SVector::push_back(std::shared_ptr pValue) { isInit = true; array.emplace_back(pValue); } template void SVector::push_back(const T &value) { isInit = true; array.push_back(std::shared_ptr(value)); } template std::shared_ptr SVector::back() const { if (!isInit || array.empty()) return {}; return array.back(); } template std::shared_ptr SVector::front() const { if (!isInit || array.empty()) return {}; return array.front(); } template std::shared_ptr SVector::dequeue() { auto pElement = front(); array.erase(array.begin()); return pElement; }