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: Re: Cmath and math.h Changes in Xcode 2.4



On 8/29/06, E. Wing <email@hidden> wrote:
> The "correct C++" way of doing this is:
>
> #include <cmath>
>
> You can then refer to the isnan function as std::isnan within your code.
> Alternatively you can declare:
>
> #include <cmath>
> using namespace std;
>
> ...and then not have to qualify isnan with std::
>
> Note that the above is not Apple specific.

Just to clarify, don't do 'using namespace std;' in a header file. This will
pollute the namespace of any file that ends up including this header. As I
mentioned, OSG's math stuff is in a public header, so this would wreak havoc
on people's code.

You can use just 'using std::isnan' if you want to avoid using std:: everywhere you use isnan, but also avoid polluting the namespace.

Lucas
_______________________________________________
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: Cmath and math.h Changes in Xcode 2.4 (From: "E. Wing" <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.