#include#include int main() { QList list = {1, 2, 3, 4, 5}; int front = list.pop_front(); qDebug() << "Removed front item: " << front; qDebug() << "New list: " << list; return 0; }
Removed front item: 1 New list: [2, 3, 4, 5]
#include#include int main() { QList list = {"apple", "orange", "banana", "grape"}; QString front = list.pop_front(); qDebug() << "Removed front item: " << front; qDebug() << "New list: " << list; return 0; }
Removed front item: "apple" New list: ["orange", "banana", "grape"]The QList class is part of the QtCore package in Qt library.