There is a vector implementation, not from std space, but approximately similar in functionality. Here are some excerpts of the server and client.
Vect.h file
#pragma once #include <iostream> #include <string> #include "VectError.h" template<typename T>class Vect { public: explicit Vect() :first(0), last(0) {} explicit Vect(size_t _n, const T& _v = T()) {//интересующая часть, как //работает конструктор T(), откуда он?? Allocate(_n); for (size_t i = 0; i < _n; ++i) *(first + i) = _v; } Vect(const Vect&); Vect& operator=(const Vect&); ~Vect() { #ifdef DEBUG cout << "Destructor of " << markName << endl; #endif // DEBUG Destroy(); first = 0, last = 0; } void mark(std::string& name) { markName = name; } std::string mark()const { return markName; } size_t size()const; T* begin()const { return first; } T* end()const { return last; } T& operator[](size_t i); void insert(T* _P, const T& _x); void push_back(const T& _x); void pop_back(); void show()const; protected: void Allocate(size_t _n) { first = new T[_n * sizeof(T)]; last = first + _n; } void Destroy() { for (T* p = first; p != last; ++p)p->~T(); delete[] first; } T* first; T* last; std::string markName; }; Excerpts from main.cpp
#include "stdafx.h" #include <iostream> #include <conio.h> #include "Vect.h" #include <string> ... int main() { try { Vect<int> v1(10);// вызывается конструктор //explicit Vect(size_t _n, const T& _v = T())... v1.mark(string ("v1")); size_t n = v1.size(); for (int i = 0; i < n; ++i)v1[i] = i + 1; v1.show(); .... } It is not clear why in Vect<int> v1(10) _v in the expression const T& _v = T() by default equal to zero, (from where?) And why you can ignore the full fill in general, because in my opinion there is no corresponding constructor overload. Thank you in advance.