[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hi everybody!



Michael Day schrieb:
> 
> > egcs doesnīt know the "export" keyword yet (which is serious, I agree
> > here), but besides that I donīt know of any greater flaws. Perhaps some
> > suboptimal optimization of templates, but nothing serious.
> 
> Hmm what is the export keyword? Closest I can think of is extern, or do
> you mean explicit? A good compiler test for C++ features that push the

No. export is correct ;)

It is used when you implement a template function in some source file
and want to use it in another. example:

---- templ.cc ----
#include "templ.h"

export void template <class C> PrintIt (C Parameter)
{
	cout << C;
}
------------------

---- templ.h -----
void template <class C> PrintIt (C Parameter);
------------------

---- main.cc -----
#include "templ.h"

int main (void)
{
	PrintIt (42);
	PrintIt ("Hello World");

	return 0;
}
------------------

without the "export" the linker wonīt find a "PrintIt (int)" and
"PrintIt (char *)" when linking main.o


	Christian