// Error a propósito: el destructor lee node->next después de borrar node.
struct Node {
    int value;
    Node* next;
};

class BadList {
public:
    BadList() = default;
    BadList(const BadList&) = delete;
    BadList& operator=(const BadList&) = delete;

    ~BadList() {
        for (Node* node = head_; node != nullptr; node = node->next) {
            delete node;
        }
    }

    void push_front(int value) { head_ = new Node{value, head_}; }

private:
    Node* head_ = nullptr;
};

int main() {
    BadList list;
    list.push_front(1);
    list.push_front(2);
    return 0;
}
