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



Thank you all for you help. Yes a couple of you where correct, I was pulling in a header file that was defining max, min. Because we use a lot of common code here in our projects someone at some time had #defined max and min, but because it did not ‘blow up’ in my 1.5 Xcode I was stumped as to the problem.

 

Again thanks for all who took the time to answer my post.

 

Cheers

Carl

 

-----Original Message-----
From: Chris Espinosa
Sent:
Monday, October 24, 2005 6:14 PM
To: Carl Smith
Cc: email@hidden
Subject: Re: :min, std::max

 

 

On Oct 24, 2005, at 2:53 PM, Carl Smith wrote:



As an example of the exact error I am getting;

“error:expected unqualified-id before ‘(‘ token”

then the error is pointing to the line

“const streamsize __limit = std::min(__chunk, __bufavail):” in the file fstream.tcc

there are 12 such errors, all relating to std::min and std::max.

 

The usual cause for this is #defining min or max in some header file.  

 

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.

 

Chris



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.