Re: Deque / Queue
Re: Deque / Queue
- Subject: Re: Deque / Queue
- From: Kevin Grant <email@hidden>
- 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.