From: Paul A Bristow (pbristow_at_[hidden])
Date: 2006-06-22 11:13:24
| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of Eric Niebler
| Sent: 20 June 2006 20:26
| To: boost_at_[hidden]
| Subject: Re: [boost] [test] test/included min max macro issue
| Paul A Bristow wrote:
| > | -----Original Message-----
| > | From: boost-bounces_at_[hidden]
| > | [mailto:boost-bounces_at_[hidden]] On Behalf Of Eric Niebler
| > |
| > | Just to clarify, all Boost libraries aim for complete
| > | 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 A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow_at_[hidden]