Re: C++ templates: no support for 'export' ?
Re: C++ templates: no support for 'export' ?
- Subject: Re: C++ templates: no support for 'export' ?
- From: "Chris Jefferson" <email@hidden>
- Date: Sun, 30 Mar 2008 23:26:58 +0100
On 30/03/2008, Dan Caugherty <email@hidden> wrote:
> Hi all --
>
> I was really hoping not to include a large template method in a *.h
> file,
> but alas, it looks like I can't get around this warning:
>
> warning: keyword 'export' not implemented, and will be ignored
>
> This looks like a GCC 4.0 warning that has nothing to do with Xcode 3.0,
> unless I've missed something.
>
> What other source code organization strategies can I try, other than
> (gag)
> sticking all of my class methods in the header?
There are very few compilers which implement export, and gcc have said
that they never will implement it.
The traditional way of dealing with this, and the one used by gcc
itself, is to do put what you would like to export into a file called
either "header.hpp" or "header_implementation.h", and #include it at
the end of the "header.h" it defines the methods of.
Unfortunately, it's unavoidable you have to put those methods into a
header. It doesn't slow down compiling as much as you might expect,
particularly if you use pre-compiled headers.
There are other ways of avoiding compiling many times, but I have
found in the past they are more trouble than they are worth...
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden