Hi Jason
> Sorry, I totally disagree on the "easier to read" part. Template
> syntax is a nightmare!
No wanting to sound patronising, but it's just a matter of practice. As
as you realise the huge benefits Teampltes give you, you'll never stop
using them. However, it is possible to over use them.
> > > class COMInit
> > {
> > COMInit() { CoInitialize( NULL ); }
> > ~COMInit() { CoUninitialize(); }
> > } const g_init;
>
> Interesting way of doing it.
How else would you do it? :-)
The above obeys the RAII (Resource Aquisition is Initialisation) idiom
as well order of initialisation.
I wouldn't do it quite the same way as Ehsan, unless of course the
above is a class dcalred and defined local to main?
Regards
Paul
Paul Grenyer
Email: [EMAIL PROTECTED]
Web: http://www.paulgrenyer.co.uk
Have you met Aeryn: http://www.paulgrenyer.co.uk/aeryn/?
Version 0.3.0 beta now available for download.