Rewrite this code for the GCC compiler with the following modifications: Make the dynamic data structure into a static library - a header file and an implementation file.
Pass the contents of the dynamic structure elements as arguments to the program. Code: #include <iostream>

using namespace std;

class Element {
public:
    int priority;
    int value;
};

class queue {
private:
    Element *elements;
    int size = 0;
    int capacity = 10;
    int highestpriority() {
        int highest = 0;
        for (int i = 1; i < size; i++) {
            if (elements[highest].priority < elements[i].priority) {
                highest = i;
            }
        }
        return highest;
    }

public:
    queue() {
        elements = new Element[capacity];
    }
    ~queue() {
        for (int i = 0; i < size; i++) {
            delete[] &elements[i].priority;
        }
    }
    void enqueue(int priority, int value) {
        Element newel;
        newel.priority = priority;
        newel.value = value;
        int buffv, buffp, flag = 0;
        if (size + 1 > capacity) {
            capacity = 2;
            Element *newElements = new Element[capacity];
            for (int i = 0; i < size; i++) {
                newElements[i] = elements[i];
            }
            delete[] elements;
            elements = newElements;
        }
        elements[size] = newel;
        size++;
        for (int i = size - 2; i > -1; i--) {
            if (flag == 0) {
                if ((elements[i].priority > elements[size - 1].priority)) {
                    flag = 1;
                } else {
                    if ((i == 0) && (elements[i].priority < elements[size - 1].priority)) {
                        for (int j = size - 1; j > i; j--) {
                            buffv = elements[j].value;
                            buffp = elements[j].priority;
                            elements[j].value = elements[j - 1].value;
                            elements[j].priority = elements[j - 1].priority;
                            elements[j - 1].value = buffv;
                            elements[j - 1].priority = buffp;
                            flag = 1;
                        }
                    }
                    if ((elements[i].priority < elements[size - 1].priority) &&
(elements[i - 1].priority > elements[size - 1].priority)) {
                        for (int j = size - 1; j > i; j--) {
                            buffv = elements[j].value;
                            buffp = elements[j].priority;
                            elements[j].value = elements[j - 1].value;
                            elements[j].priority = elements[j - 1].priority;
                            elements[j - 1].value = buffv;
                            elements[j - 1].priority = buffp;
                            flag = 1;
                        }
                    }
                    if ((elements[i].priority == elements[size - 1].priority)) {
                        for (int j = size - 1; j > i + 1; j--) {
                            buffv = elements[j].value;
                            buffp = elements[j].priority;
                            elements[j].value = elements[j - 1].value;
                            elements[j].priority = elements[j - 1].priority;
                            elements[j - 1].value = buffv;
                            elements[j - 1].priority = buffp;
                            flag = 1;
                        }
                    }
                }
            }
        }
    }
    Element wthdrw(int index) {
        return elements[index];
    }
    Element unqueue() {
        int highestindex = highestpriority();
        Element result = elements[highestindex];
        if (size == 0) {
            cout << "Очередь пустая\n";
            return result;
        }
        for (int i = highestindex; i < size - 1; i++) {
            elements[i] = elements[i + 1];
        }
        size--;
        return result;
    }

    bool isclear() {
        return size == 0;
    }

    int getSize() {
        return size;
    }
};
int main() {
    setlocale(LC_ALL, "rus");
    queue queue1;
    queue1.enqueue(1, 10);
    queue1.enqueue(5, 30);
    queue1.enqueue(5, 20);
    queue1.enqueue(1, 40);
    queue1.enqueue(5, 25);
    queue1.enqueue(3, 50);
    for (int i = 0; i < queue1.getSize(); i++) {
        cout << "Элемент под индексом " << i + 1 << " имеет значение " << queue1.wthdrw(i).value << " и приоритет "
<< queue1.wthdrw(i).priority << endl;
    }
    cout << endl;
    while (!queue1.isclear()) {
        Element earliestelement = queue1.unqueue();
        cout << "Элемент вышел. Приоритет элемента - " << earliestelement.priority << " , значение элемента - "
<< earliestelement.value << endl;
    }
    return 0;
queue1.~queue();
}