This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

interface/implementation: export keyword?



I'm trying to sensibly separate template definitions/declarations for
a project I'm writing in C++, as I believe (?) it's good practice to
separate the interface from the implementation.

The use of the "export" keyword for template definitions gets flagged
by egcs-1.1b as a syntax error, which I assume means it isn't
supported.  I also tried using the #pragma interface/implementation
construction but it doesn't appear to do anything (or certainly not
what I expect it to).  As a last resort I tried to do it using
preprocessor directives, which works after a fashion but is utterly
unmaintainable.

After reading the egcs info pages and scanning the egcs source (!)
I'm none the wiser, and I couldn't find this as a FAQ anywhere
either.  I even tried looking at the source of some other C++
template libraries (STL, blitz++), but they don't appear to be
enforcing the distinction between interface and implementation at what
I'd thought was an obvious boundary.
 
I'd therefore appreciate some advice from someone who's been there and
done that, preferably with (a pointer to) a simple program
demonstrating the technique ;-)

Thanks,

TJW

--------------------------------------------------------------------
Terence J. Wells                E-mail  : tjw30@cam.ac.uk
St John's College               Phone   : +44.468.916617 (mobile)
Cambridge CB2 1TP               Room    : A3 New Court, SJC
United Kingdom                  Talk    : tjw30@tjw30.joh.cam.ac.uk



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]