Boost logo

Boost Users :

Subject: Re: [Boost-users] [heap] Mix use of size_t and size_type
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2015-03-12 06:47:10


> -----Original Message-----
> From: Boost-users [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Ben Pope
> Sent: 12 March 2015 10:05
> To: boost-users_at_[hidden]
> 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_at_[hidden]] On
> >> Behalf Of Ben Pope
> >> Sent: 12 March 2015 01:56
> >> To: boost-users_at_[hidden]
> >> 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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net