Subject: Re: c++
To: Todd Vierling <tv@pobox.com>
From: Patrick Welche <prlw1@cam.ac.uk>
List: tech-toolchain
Date: 09/18/1998 22:27:09
Todd Vierling wrote:
> 
> On Fri, 18 Sep 1998, Patrick Welche wrote:
> 
> : I was reading "C++ Primer 3rd ed" by Lippman and Lajoie, who suggest
> : that using "export" means that you do not need to specialize the class
> : explicitly in the implementation file (when merely declaring the
> : template in the header file).
> 
> `Ick.'  That's a `rather odd' way of doing it, and would definitely require
> extra compiler stages to make use of it.

To quote:

	The "export" keyword indicates to the compiler that the
	template definition might be needed to generate function
	template instantiations used in other files. The compiler must
	then ensure that the template definition is available when
	these instantiations are generated.

I suppose that last sentence implies a lot of work. Meanwhile, here's
a surprising code snippet:

#include <iostream>
#include <string>

int main()
{ 
  int _B=10;
  
  cout<<_B<<endl;
  
  return 0;
}

Try g++ -E on it, and view the output. With #include <string>, the _B
is changed to 0x80.

Cheers,

Patrick