[Bro-Dev] Rethinking Broker's blocking API

Robin Sommer robin at icir.org
Tue Jan 10 06:21:54 PST 2017



On Mon, Jan 09, 2017 at 11:34 -0800, you wrote:

> 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.

>     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() })".

Robin

-- 
Robin Sommer * ICSI/LBNL * robin at icir.org * www.icir.org/robin


More information about the bro-dev mailing list