Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: :min, std::max




On 25.10.2005, at 10:39, Paul Walmsley wrote:


And of course this can be fixed by doing
#undef min
#undef max
after including any C header.

But sometimes I find this can cause problems if you're using precompiled headers -- you may need to fiddle with the ordering of your inclusions. It's a pain when you have C headers that define min and max. My solution is usually to duplicate std::min and max but call it something slightly different, eg MaxValue()

It's a pain when people carelessly define macros in public headers like min, max, I, _R, etc. etc.
Also, it's careless when people using names like _R, like in the GNU standard lib.


In a carbon produtc it's also a pain, getting ur source blown up when using the names check, verify and require.
I want to blame Apple here!
Really, i would appreciate it very much if Apple could get rid of these b.d. names in AssertMacros.h!



Andreas





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/ email@hidden


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >RE: :min, std::max (From: "Carl Smith" <email@hidden>)
 >Re: :min, std::max (From: Chris Espinosa <email@hidden>)
 >Re: :min, std::max (From: Tommy Nordgren <email@hidden>)
 >Re: :min, std::max (From: Paul Walmsley <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.