Перепиши код так, чтобы работали все операторы

namespace baobab {

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
class order
{

private:
int index = 0;
int* arrr = new int[index];
public:
friend void transfer(order&, int& i, int& pickelem);
friend void pickindex(order&, int& indext);
// перегрузка оператора “+”
order operator+(order& order2) const {
order result;
for (int i = 0; i < this->index; i++) {
result.push(this->arrr[i]);
}
for (int i = 0; i < order2.index; i++) {
result.push(order2.arrr[i]);
}
return result;
}
// перегрузка оператора “=”
order& operator=(const order& other) {
if (this != &other) {
this->index = other.index;
delete[] this->arrr;
this->arrr = new int[this->index];
for (int i = 0; i < this->index; i++) {
this->arrr[i] = other.arrr[i];
}
}
return *this;
}
int push(int num) {
if (index < 10) {
arrr[index] = num;
index++;
return 0;
}
else return 1;
}

void pop()
{
for (int i = 0; i < index; i++)
{
arrr[i] = arrr[i + 1];
}
index–;
}
};
order h;
/// <summary>
/// Сводка для MyForm
/// </summary>
public ref class MyForm : public System::Windows::Forms::Form
{
public:
MyForm(void)
{
InitializeComponent();
//
//TODO: добавьте код конструктора
//
}
protected:
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
~MyForm()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::ListBox^ listBox1;
private: System::Windows::Forms::ListBox^ listBox2;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::Label^ label4;
protected:

private:
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
void InitializeComponent(void)
{
this->button1 = (gcnew System::Windows::Forms::Button());
this->button2 = (gcnew System::Windows::Forms::Button());
this->listBox1 = (gcnew System::Windows::Forms::ListBox());
this->listBox2 = (gcnew System::Windows::Forms::ListBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->label3 = (gcnew System::Windows::Forms::Label());
this->button3 = (gcnew System::Windows::Forms::Button());
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->label4 = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// button1
//
this->button1->BackColor = System::Drawing::SystemColors::ButtonFace;
this->button1->Cursor = System::Windows::Forms::Cursors::Hand;
this->button1->Location = System::Drawing::Point(181, 99);
this->button1->Margin = System::Windows::Forms::Padding(2);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(85, 32);
this->button1->TabIndex = 0;
this->button1->Text = L"Push";
this->button1->UseVisualStyleBackColor = false;
this->button1->Click += gcnew System::EventHandler(this, &MyForm::button1_Click);
//
// button2
//
this->button2->Cursor = System::Windows::Forms::Cursors::Hand;
this->button2->Location = System::Drawing::Point(181, 135);
this->button2->Margin = System::Windows::Forms::Padding(2);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(85, 30);
this->button2->TabIndex = 1;
this->button2->Text = L"Pop";
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &MyForm::button2_Click);
//
// listBox1
//
this->listBox1->FormattingEnabled = true;
this->listBox1->Location = System::Drawing::Point(11, 25);
this->listBox1->Margin = System::Windows::Forms::Padding(2);
this->listBox1->Name = L"listBox1";
this->listBox1->Size = System::Drawing::Size(80, 173);
this->listBox1->TabIndex = 2;
//
// listBox2
//
this->listBox2->FormattingEnabled = true;
this->listBox2->Location = System::Drawing::Point(95, 25);
this->listBox2->Margin = System::Windows::Forms::Padding(2);
this->listBox2->Name = L"listBox2";
this->listBox2->Size = System::Drawing::Size(82, 173);
this->listBox2->TabIndex = 3;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(11, 6);
this->label1->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(78, 13);
this->label1->TabIndex = 4;
this->label1->Text = L"Struct contains";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(92, 6);
this->label2->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(68, 13);
this->label2->TabIndex = 5;
this->label2->Text = L"Current items";
//
// label3
//
this->label3->AutoSize = true;
this->label3->Location = System::Drawing::Point(178, 84);
this->label3->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(39, 13);
this->label3->TabIndex = 6;
this->label3->Text = L"Label3";
//
// button3
//
this->button3->Cursor = System::Windows::Forms::Cursors::Hand;
this->button3->Location = System::Drawing::Point(181, 169);
this->button3->Margin = System::Windows::Forms::Padding(2);
this->button3->Name = L"button3";
this->button3->Size = System::Drawing::Size(85, 29);
this->button3->TabIndex = 7;
this->button3->Text = L"Show struct";
this->button3->UseVisualStyleBackColor = true;
this->button3->Click += gcnew System::EventHandler(this, &MyForm::button3_Click);
//
// textBox1
//
this->textBox1->Location = System::Drawing::Point(181, 25);
this->textBox1->Margin = System::Windows::Forms::Padding(2);
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(85, 20);
this->textBox1->TabIndex = 8;
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System::Drawing::Point(178, 6);
this->label4->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(31, 13);
this->label4->TabIndex = 9;
this->label4->Text = L"Input";
//
// MyForm
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::SystemColors::GradientActiveCaption;
this->ClientSize = System::Drawing::Size(276, 210);
this->Controls->Add(this->label4);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->button3);
this->Controls->Add(this->label3);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->listBox2);
this->Controls->Add(this->listBox1);
this->Controls->Add(this->button2);
this->Controls->Add(this->button1);
this->Cursor = System::Windows::Forms::Cursors::IBeam;
this->Margin = System::Windows::Forms::Padding(2);
this->Name = L"MyForm";
this->Text = L"MyForm";
this->ResumeLayout(false);
this->PerformLayout();

}

#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
//push
h.push(System::Convert::ToInt32(textBox1->Text));
if (listBox2->Items->Count < 10)
listBox2->Items->Add(System::Convert::ToInt32(textBox1->Text));
if (listBox2->Items->Count == 10)
{
button1->Enabled = false;
button1->BackColor = System::Drawing::SystemColors::ControlDarkDark;
label3->Text = “order full”;
}
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e)
{
//pop
if (listBox2->Items->Count >= 1)
{
h.pop();
listBox2->Items->RemoveAt(0);
if (button1->Enabled == false)
{
button1->Enabled = true;
button1->BackColor = System::Drawing::SystemColors::Control;
label3->Text = “”;
}
}
}

private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e)
{
//show struct
listBox1->Items->Clear();
int pickedelem(0), indext(0);
pickindex(h, indext);
for (int j = 0; j < indext; j++)
{
transfer(h, j, pickedelem);
listBox1->Items->Add(pickedelem);
}
}
};
void pickindex(order& h, int& indext)
{
indext = h.index;
}
void transfer(order& h, int& i, int& pickelem)
{
pickelem = h.arrr[i];
}
}