[TriLUG] The C++ STL library

Tanner Lovelace lovelace at wayfarer.org
Fri Dec 5 10:09:17 EST 2003


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 222 bytes
Desc: not available
URL: <http://www.trilug.org/pipermail/trilug/attachments/20031205/24139fc9/attachment.pgp>


More information about the TriLUG mailing list