IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Did you read the bit about explicit instantiations?
[link|http://www.network-theory.co.uk/docs/gccintro/gccintro_60.html|http://www.network-t.../gccintro_60.html]

Explicit instantiation can also be used to make libraries of precompiled template functions, by creating an object file containing all the required instantiations of a template function (as in the file 'templates.cc' above). For example, the object file created from the template instantiations above contains the machine code needed for Buffer classes with 'float', 'double' and 'int' types, and could be distributed in a library.


I wouldn't be surprised if STL didn't ship with a pre-built library for all native types constructed by including all the source in one big file with explicit instantiations and compiling it down to a lib.

Are you dead sure that the headers don't include the source?



"Whenever you find you are on the side of the majority, it is time to pause and reflect"   --Mark Twain

"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."   --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."   --George W. Bush
Expand Edited by tuberculosis Aug. 21, 2007, 06:14:56 AM EDT
New Yes, but I didn't think it applied
How in the world could the STL precompile for a list of pointers to maps, eahc of which uses an unsigned int for a key value and a pointer to a deque of unsigned longs as the target value? To wit:

\ntypedef list<(map<uint32_t, deque<uint32_t> * >)*>\n


I think you'll agree that that permutation isn't likely to occur as a "standard" one. Yet that would have to be one of them if they have predefined the list code, because the erase() method of a list (for instance) is not in the header.

As far as being dead sure, well...as you are most probably aware, the authors of every STL I've ever seen the headers for are the anti-Dickens of the coding world (i.e. they get paid in inverse proportion to the number of keystrokes used)...It's just plain gawd-awful. I'd summarily fire any programmer who wrote code like that in my shop! Nonetheless, grep is my friend and so searching the entire file for the names of functions that are in the interface, it will occasionally find ones that are not defined. For example, this member function declaration taken from stl_list.h:

\n      iterator\n      erase(iterator __position);\n\n


erase is a function taking an iterator and returning an iterator. But no code...just a declaration.
template<typename _Tp, typename _Alloc = allocator<_Tp> > iterator list<_Tp, _Alloc>::erase (iterator __position) would have to be defined elsewhere, for specific types of both _Tp and _Alloc, or the linker wouldn't find it.
jb4
shrub●bish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT

     g++ question - (jb4) - (6)
         You can't get there from here - (tuberculosis) - (3)
             You gotta go around - (jb4) - (2)
                 Did you read the bit about explicit instantiations? - (tuberculosis) - (1)
                     Yes, but I didn't think it applied - (jb4)
         If you know the specializing classes in advance - (Arkadiy) - (1)
             Sounds like the STL was build using -frepo - (jb4)

Is that a Dune reference?
107 ms