This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: faq.html (was: "FAQ patch")
- To: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- Subject: PATCH: faq.html (was: "FAQ patch")
- From: Rich Churcher <churcher at ihug dot com dot au>
- Date: 03 Jul 2001 01:50:41 +1000
- Cc: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>, <gcc-patches at gcc dot gnu dot org>
- References: <Pine.BSF.4.33.0107021217490.77915-100000@taygeta.dbai.tuwien.ac.at>
Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> writes:
> Rich, if there are any outstanding patches or mails of yours which I
> haven't addressed in, say 24 hours, please drop me some pointer or resend,
> and I'll have a look ASAP. (I hope this did not happen, but I might have
> missed something while reducing my huge backlog.)
Joseph has been very patiently vetting my patches for me, so I don't
think there are any outstanding. Here's another I thought of adding,
perhaps you could look at it when you have a moment.
[To be honest, the long lines in diff output - this has always confused
me. What is it we have to avoid, again? Is it enough that my mail
client doesn't wrap long lines, or should I edit long lines prior to
invoking cvs diff? I could make sure everything in existing markup
doesn't go past 70 characters or so if necessary.]
2001-07-03 Rich Churcher <churcher@ihug.com.au>
* Add question to cover lack of export keyword
Index: faq.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/faq.html,v
retrieving revision 1.164
diff -u -3 -p -r1.164 faq.html
--- faq.html 2001/07/01 14:48:20 1.164
+++ faq.html 2001/07/02 09:54:22
@@ -63,6 +63,7 @@ page</a>.</p>
<li><a href="#stdin">Why can't I initialize a static variable with <tt>stdin</tt>?</a></li>
<li><a href="#macarg">Why can't I use #if here?</a></li>
<li><a href="#rounding">Problems with floating point computations</a></li>
+ <li><a href="#export">Why can't I put template definitions in a separate file?</a></li>
</ol></li>
<li><a href="#old">Older versions of GCC or EGCS</a></li>
@@ -611,6 +612,20 @@ to round to the nearest representable nu
the float and double types. Please study
<a href="http://www.validgh.com/goldberg/paper.ps">this paper</a>
for more information.</p>
+
+<hr>
+<h2><a name="export">Why can't I put template definitions in a
+separate file?</a></h2>
+
+<p>Most C++ compilers (G++ included) do not yet implement the
+<code>export</code> keyword, which is necessary for separate
+compilation of template declarations and definitions. Without
+<code>export</code>, a template definition must be in scope to be
+used.</p>
+
+<p>The obvious workaround is simply to place all definitions in the
+header itself. Alternatively, the compilation unit containing template
+definitions may be included from the header.</p>
<hr>
<a name="old"></a>
--
Cheers,
Rich.