Following code push two structs in one queue.
#include <variant>
#include <queue>
struct EventRequest
{
char EventType;
int RetryCount;
};
struct EventStatus
{
char EventType;
char StatusType;
short RetryCount;
};
using AnyEvent = std::variant<EventRequest, EventStatus>;
int main()
{
std::queue<AnyEvent> event;
event.push(EventRequest());
event.push(EventStatus());
return 0;
}
I am trying to read the front of the queue. How do I make a declaration which will return to the front of the queue?
?? = event.front();
How do I declare the question marked area?