how to spsc_queue.pop() this struct?
I'm trying to spsc_queue.pop() this struct
enum action_type {
SUBSCRIBE,
UNSUBSCRIBE,
MESSAGE
};
struct action {
action() = default ;
action(action_type t, connection_hdl h) : type(t), hdl(h) {}
action(action_type t, server::message_ptr m) : type(t), msg(m) {}
action_type type;
websocketpp::connection_hdl hdl;
server::message_ptr msg;
};
with
action a;
while(m_actions.pop(a)){
...
but whenever I test with
std::cout << "'" << a.type << "'" << std::endl;
'0' is written to the terminal, but it should only be one of the values of
action_type. I have read that the default value for a struct is 0, but why
can't spsc_queue.pop() set a?
(boost::lockfree::spsc_queue)
No comments:
Post a Comment