Predict the output of the following code:
#include <bits/stdc++.h>
using namespace std;
class A
{
public:
int x, y;
A(int a, int b) : x(a), y(b)
{
}
};
int main()
{
forward_list<A> fl = {{1, 2}};
fl.insert_after(fl.begin(), {3, 4});
auto it = ++fl.begin();
cout << it->x << " " << it->y;
return 0;
}
Compiler Error
3 4
1 2
0 0
This question is part of this quiz :
C++ Forward List