public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joe Buck <jbuck@synopsys.com>
To: tjw30@cam.ac.uk
Cc: egcs@cygnus.com
Subject: Re: interface/implementation: export keyword?
Date: Tue, 27 Oct 1998 16:33:00 -0000	[thread overview]
Message-ID: <199810272315.PAA18776@atrus.synopsys.com> (raw)
In-Reply-To: <Pine.LNX.3.96.981027105608.730F-100000@tjw30.joh.cam.ac.uk>

> 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 short answer is to put your template declarations in an .h file,
and your template definitions in a .cxx (or .cc) file, and until
egcs supports export, #include the .cxx file as well as the .h file
when you use the templates.

> 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.

That's because they work with existing compilers.

  reply	other threads:[~1998-10-27 16:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-27  3:15 Terence J. Wells
1998-10-27 16:33 ` Joe Buck [this message]
1998-10-28  3:53   ` Terence J. Wells
1998-10-28 18:51     ` Joe Buck
1998-10-31 16:39     ` Martin von Loewis
1998-10-29  0:50 Jan Reimers
     [not found] <71B30885B657D111809D080009EEBBF339EABC.cygnus.egcs@MAILSERV.molienergy.bc.ca>
1998-10-30  3:25 ` Nathan Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199810272315.PAA18776@atrus.synopsys.com \
    --to=jbuck@synopsys.com \
    --cc=egcs@cygnus.com \
    --cc=tjw30@cam.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).