-----Original Message----- From: Boost-users [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Ben Pope Sent: 12 March 2015 10:05 To: boost-users@lists.boost.org Subject: Re: [Boost-users] [heap] Mix use of size_t and size_type
On Thursday, March 12, 2015 05:52 PM, Paul A. Bristow wrote:
-----Original Message----- From: Boost-users [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Ben Pope Sent: 12 March 2015 01:56 To: boost-users@lists.boost.org Subject: Re: [Boost-users] [heap] Mix use of size_t and size_type
On Thursday, March 12, 2015 07:06 AM, Gavin Lambert wrote:
If you're referring to the parentheses around std::min itself, that's a standard defense against #define min().
Thanks, never seen that used before.
This is really quite important to avoid difficult-to-diagnose trouble when using Windows, whose code often makes a daft #define for min.
I haven't worked with Windows headers for a while, but I always ensured that NOMINMAX or whatever it was, was defined. Of course, that's not entirely useful if you're writing a library.
Doesn't protect your from being named'n'shamed by the Boost Inspect program ;-) http://boost.cowic.de/rc/docs-inspect-develop.html (Not that authors are a bit shameless and not taking as much notice of this as they should - perhaps we need to plop their shameful behaviour into their emailbox?) So the pesky extra brackets are The Right Thing To Do. Paul --- Paul A. Bristow Prizet Farmhouse Kendal UK LA8 8AB +44 (0) 1539 561830