From: Christophe de V. <cde...@al...> - 2003-02-11 13:37:07
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le Mardi 11 F=E9vrier 2003 14:18, Jonathan Wakely a =E9crit : > On Sun, Feb 09, 2003 at 04:25:11PM +0100, Christophe de Vienne wrote: > > Le Vendredi 7 F=E9vrier 2003 23:10, Stefan Seefeld a =E9crit : > > > The full C++ code now lives in a set of headers. There > > > was just not enough code independent of the actual > > > character type to be put into .cc files. > > > > As far as this particular point, what I personnaly do with templated > > class is that I still separate declaration and implementation into a .h > > and a .cc/.cpp file. > > Then I include the .cc/.cpp in the .h file so the templated > > implementation is still visible by user code. > > This make header much more clean and readable, and if one day we have t= he > > chance to have a c++ compiler which support the 'export' keyword, then > > adaptation will be as easy as comment 1 line of code. > > "export" is widely misunderstood. It doesn't mean separate compilation > of templates, and I'd be surprised if it sees much use even when more > compilers support it. Herb Sutter has done some interesting articles on > his experiences with the Comeau compiler, which now supports "export", > and my impression is that the complications it raises outweigh the > benefits (which apparently don't even result in quicker compilation!) > > Not that this should dictate .h/.cc policy in any way, I'm just being a > C++ bore again! You're certainly right about export. If ever it is supported efficiently it= =20 will be time to use it and construct the application around it. Not now. As far as keeping .h/.cc separation for templated class, it is essentially = for=20 readability. Christophe =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+SPxjB+sU3TyOQjARAupAAKDMVjW5BoH37o+Z8xn8dqNGQGioygCaApB0 tWoqJE7oDanradhRh6fj6Uo=3D =3DIZ6t =2D----END PGP SIGNATURE----- |