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



Often people #define min(x,y) (x < y ? x : y) and that will be expanded in the definition of std:: min, which will blow up.

And that doesn't always work either; for example, then min(++j, k) expands to (++j < k ? ++j : k) which can return j incremented twice.
--
Prof. W. Douglas Maurer Washington, DC 20052, USA
Department of Computer Science Tel. (1-202)994-5921
The George Washington University Fax (1-202)994-4875
NEW E-MAIL ADDRESS 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>)



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.