Всем привет, вот код:
| Код | #include "stdafx.h"
using namespace std;
template <class eltype> class objtype { public: objtype(const int& n=0) : a(n,0){} vector<eltype> a; };
int _tmain(int argc, _TCHAR* argv[]) { SetConsoleCP(1251); SetConsoleOutputCP(1251); int i; double s; objtype<double> x(3), y(x);
x.a[1] = 123;
copy(x.a.begin(),x.a.end(),ostream_iterator<double>(cout," ")); cout << endl;
copy(y.a.begin(),y.a.end(),ostream_iterator<double>(cout," ")); cout << endl;
return 0; }
|
Подскажите почему работает строчка:
| Код | objtype<double> x(3), y(x);
|
Кто создал конструктор копирования | Код | objtype<double>(objtype<double>&)
|
? вектор что-ли? |