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

Welcome to IWETHEY!

New If you know the specializing classes in advance
you can specialize template in your .cpp file. This way, the method bodies can be kept in .cpp files as well.

Something along the line

------------------ Class.h ------------
template <class T>
class Class
{
void f();
};

--------------------Class.cpp -----------

template <class T>
void Class<T>::f()
{
// do something
}

template class Class<int>;

template class Class<bool>;

and so on.

Please see [link|http://gcc.gnu.org/onlinedocs/gcc-4.0.2/gcc/Template-Instantiation.html#Template-Instantiation|http://gcc.gnu.org/o...ate-Instantiation] for complete discussion. They have another method in there that may be more suitable for you, but it's a method I've never used...


------

179. I will not outsource core functions.
--
[link|http://omega.med.yale.edu/~pcy5/misc/overlord2.htm|.]

New Sounds like the STL was build using -frepo
which (if I read the documentation correctly) would cause additional object files to be emitted that are then linked together by the linker.

Thanks for the link, Ark!
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)

Oops. Wrong hat.
31 ms