Mike Mueller wrote:
On Thursday 04 December 2003 16:13, Tanner Lovelace wrote:

The STL is somewhat unique in that you don't compile it. Because of how
templates work with most compilers, the STL is supplied entirely as
header files.


Templates have no compilable meaning until supplied with concrete data types in a particular instance, so they must always be a header file. How could it be otherwise - especially if the datatype is user defined?

That wasn't always the case. Also, some compilers will let you define certain types to be precompiled. I.e. if you know that your template will be often used with int's you could precompile that part and therefore save some compile time. Also, I believe some compilers used to compile to an intermediate representation that was between source code and actual object code. The advantage of this would also be faster compilation.

Cheers,
Tanner
--
Tanner Lovelace | lovelace(at)wayfarer.org | http://wtl.wayfarer.org/
--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--
GPG Fingerprint = A66C 8660 924F 5F8C 71DA  BDD0 CE09 4F8E DE76 39D4
GPG Key can be found at http://wtl.wayfarer.org/lovelace.gpg.asc
--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--
   He who receives an idea from me, receives instruction himself
   without lessening mine; as he who lights his taper at mine,
   receives light without darkening me.  --  Thomas Jefferson

Attachment: pgp00000.pgp
Description: PGP signature

-- 
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ  : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc

Reply via email to