This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Is 'export' supported?


Eric Mercer <eemercer@yuan.elen.utah.edu> writes:

> export template<class T> void out(const T& t) {std::cerr << t;}

export is not supported yet :-(

It's the major piece of the C++ language that the up-coming egcs 1.1
will not provide :-(

> Is there any way to not completely declare and define templates in the
> same file?  ( i.e. Declare the template in 1 file and define the template
> in another. )

Yes, using explicit instantiation of the needed instances in the
translation unit that defines them.  But this is only manageable for
small sets of templates, or if you have an automated tool to generate
code that performs explicit instantiation.  You'd better use automatic 
instantiation or the template repository (-frepo)

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]