Re: Deque / Queue
Re: Deque / Queue
- Subject: Re: Deque / Queue
- From: "jim smith" <email@hidden>
- Date: Sun, 22 Feb 2004 17:57:21 +0000
Hello Kevin,
It seems to be that my first reply to your mail is lost... .
If it comes twice I am sorry.
Kevin, Thank your for your answer.
I use these kinds of headers, they are always found automatically; is it
possible your source files don't have a recognized C++ extension? Perhaps
the C compiler is being used on them.
-> Hmmm, I thought it. I've looked in "XCode\Preferences" to find an option
to change the compiler. But I do not found someting... .
I am sorry. So - here comes my next question. Where can I change this.
Thank you.
Jim
From: Kevin Grant <email@hidden>
To: jim smith <email@hidden>
CC: email@hidden
Subject: Re: Deque / Queue
Date: Sun, 22 Feb 2004 11:11:24 -0600
It is the first time I write to this list.
I am porting a windows app to Mac.
So I try to do it with XCode and Panther.
Hopefully someone can help me.
I like to use Deque or Queue...
So I try
#include <deque> // or <deque.h>
#include <queue>
But XCode does not know this files.
So how it works with XCode / Mac?
One more question - how is the trick to use std::functions
I use these kinds of headers, they are always found automatically; is it
possible your source files don't have a recognized C++ extension? Perhaps
the C compiler is being used on them.
The GCC 3.x compiler series in Panther is very C++-standards-compliant, so
the "std" namespace is required for all standard C and C++ components.
There are three ways to work around this:
1. Explicitly change all uses to have an "std::" prefix, e.g.
strcpy->std::strcpy, vector->std::vector. I strongly recommend this
approach, even if it does take time to update your code.
2. Add explicit "using" statements to source files, for the things you want
imported. For example, if your code only calls strcpy, you only need
"using std::strcpy".
3. Add an umbrella import of the entire namespace in your source files,
with "using namespace std;". This can have a lot of side effects, but is
the quickest way to get your code working especially if it already compiled
without conflicts previously. This previous ever using "std::", but then
you lose all the benefits of having "std::" in the first place. Also,
don't put this in a header file; it would pollute the namespace of anything
that #includes the header, which can cause a lot of problems.
Hope this helps,
Kevin G.
http://homepage.mac.com/kmg/
mail to kevin at ieee dot org
_________________________________________________________________
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.