On Fri, 2008-07-18 at 17:51 +0100, Gordon Sim wrote: > Andrew Stitcher wrote: > >> On Fri, 2008-07-18 at 13:07 +0200, Manuel Teira wrote: > >>> 8.- The queue issue. Some solaris header defines a struct name as > >>> 'queue'. Usage of that name in constructions like: > >>> > >>> session.queueDeclare(queue=q); > >>> session.messageSubscribe(queue=q, destination=dest, acquireMode=1); > >>> > >>> fires a compiler error, presumably because queue is a struct name. To > >>> avoid that, I decided to change that usage to: > >>> > >>> session.queueDeclare(arg::queue=q); > >>> session.messageSubscribe(arg::queue=q, arg::destination=dest, > >>> arg::acquireMode=1); > >>> > >>> Not the cleanest one, I know. Any idea to improve it? > > > > There's probably no good fix for this - ISTR that queue is defined > > somewhere in the Solaris streams headers and is virtually impossible to > > avoid in any code that includes much in usr/include/sys. Having said > > that it might just be possible by very careful including, but I don't > > hold out much hope. > > Personally I think the change itself is fine in any case. I think all > the examples and the bulk of the tests use the arg:: qualifier anyway. >
+1. It's good practice to always use the arg:: qualifier since there are so many argument keywords (queue, destination, exchange etc.) that could potentially clash with names from unrelated headers (or even from our own - queue used to cause a self-clash at one point though not anymore)
