I am using Doubly Linked List Data Structure of CPP and have written the following code
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
list <int> l1[64];
l1[1].push_back(100);
l1[2].push_back(200);
int p=l1[1].pop_front();
cout<<p<<endl;
p=l1[2].pop_front();
cout<<p<<endl;
}
But I am getting this errors-->
trial.cpp: In function ‘int main()’:
trial.cpp:15:23: error: void value not ignored as it ought to be
15 | int p=l1[1].pop_front();
| ~~~~~~~~~~~~~~~^~
trial.cpp:17:20: error: void value not ignored as it ought to be
17 | p=l1[2].pop_front();
| ~~~~~~~~~~~~~~~^~
I am unable to understand the reason for this error, because I am just popping the first element into the p variable and printing it. Then why am I getting this error?