
| -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Eric Niebler | Sent: 20 June 2006 20:26 | To: boost@lists.boost.org | Subject: Re: [boost] [test] test/included min max macro issue | | | Paul A Bristow wrote: | > | > | > | -----Original Message----- | > | From: boost-bounces@lists.boost.org | > | [mailto:boost-bounces@lists.boost.org] On Behalf Of Eric Niebler | > | | > | Just to clarify, all Boost libraries aim for complete | neutrality | > | regarding the min/max macros. They should compile cleanly | > | regardless of | > | whether the macros are defined or not, and should neither | > | cause them to | > | be defined (unless they must include system headers which | > | define them) | > | or undefine them. | > | | > | http://boost.org/more/lib_guide.htm | > | > Says: | > | > # If you want to call std::numeric_limits<int>::max(), use | > (std::numeric_limits<int>::max)() instead. | > | > # If you want to call a min() or max() member function, | instead to doing | > obj.min(), use (obj.min)(). | > | > Just to be clear, are you saying that these forms should | ALWAYS be used in | > all code that might encounter windows.h or the min max | macros (which | > obviously includes all Boost code)? | > | > This is a minor PITA, but we could get used to it :-( | | That's exactly what I'm saying. Any time your fingers type "min" or | "max", you should ask yourself if the min/max macros will | make a hash of | your code. If you forget, the Boost.Inspect tool, which is | run by the | release manager, will remind you. It automatically checks | for violations | of Boost's min/max guidelines. Thanks for making this absolutely clear. I am sure I am not alone in needing to put some serious global grepping on my TODO list. Paul --- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com