Linked list copy constructor This is a working linked list that will be used as a vector. Instead of using dynamic arrays, I am using a linked list. I would like to see a more concise solution without utilizing the STL.

SimpleVector.h

class SimpleVector
{

public:

    SimpleVector(){
        head = nullptr;
    }
    SimpleVector(const SimpleVector &amp;);
    ~SimpleVector();

    void appendNode(const int value);
    void insertNode(const int value);
    int getElementAt(const int index);
    void displayVect();

private:

    struct Node
    {
        int value;
        Node *next;
    };

    Node *head;

};


Copy constructor implementation 

SimpleVector::SimpleVector(const SimpleVector &amp;obj)
{

    Node *oldNodePtr;
    Node *newNodePtr;

    // Initialize head to nullptr incase obj is empty
    this-&gt;head = nullptr;

    // Position oldNodePtr to the head of the list.
    oldNodePtr = obj.head;

    if (oldNodePtr != nullptr) {

        // Create new node. This is the first node in the new list
        Node *newNode = new Node;
        newNode-&gt;value = oldNodePtr-&gt;value;

        // Set head to new node address
        this-&gt;head = newNode;

        newNodePtr = newNode;

        oldNodePtr = oldNodePtr-&gt;next;

        // While oldNodePtr points to a node, traverse the list.
        while (oldNodePtr-&gt;next != nullptr) {

            Node *newNode = new Node;
            newNode-&gt;value = oldNodePtr-&gt;value;
            newNodePtr-&gt;next = newNode;
            newNodePtr = newNodePtr-&gt;next;

            oldNodePtr = oldNodePtr-&gt;next;
        }

        Node *lastNode = new Node;
        lastNode-&gt;value = oldNodePtr-&gt;value;
        newNodePtr-&gt;next = lastNode;
        lastNode = nullptr;
    }
}
A standard dummy node trick (along with appropriate Node::Node constructors) greatly simplifies the code:

    SimpleVector::SimpleVector(const SimpleVector &amp;obj)
    {
        Node dummy;

        for (Node * o = obj.head, *n = &amp;dummy; o; o = o-&gt;next) {
            n-&gt;next = new Node(o-&gt;value);                
            n = n-&gt;next;
        }

        this-&gt;head = dummy.next;
    }


To utilize STL, you need to implement iterators.