
3 Nov
2007
3 Nov
'07
7:30 a.m.
I don't think making file_entry is a lot of work. It's pretty simple and straightforward. And once it's made, you keep it around in your arsenal.
Not to split hairs here, but you could also write: boost::shared_ptr<FILE> open_file( char const * name, char const * mode ) { if( FILE * f = fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw fopen_error(name,mode); } and keep that in your "arsenal". In fact, I think this function would be a good addition to boost so it's part of everyone's arsenal. :) -- Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode