> > To distinguish between the two status, I use operator bool. > > I don't see that in the "status and error handling" section. Would I > do "if (! status) { <error stuff> }"? That doesn't seem quite > intuitive. I think a method with a descriptive name would be better > here.
Sorry, that was misleading. Statuses don't provide an operator bool. They could, however, to distinguish them from errors. > > if (auto data = msg.data()) > > f(*data) > > else > > g(*msg.status()) > > For this I think I prefer the boolean version: "if (msg) { <use > msg.data() })". Okay, I'll switch that over. I prefer the other way, though :-). Matthias _______________________________________________ bro-dev mailing list bro-dev@bro.org http://mailman.icsi.berkeley.edu/mailman/listinfo/bro-dev