
5 Nov
2009
5 Nov
'09
7:15 p.m.
Eric MALENFANT wrote:
Andrey Semashev wrote:
Is this the right way to do this? Is there a portable way to do it?
My understanding of http://www.boost.org/doc/libs/1_40_0/libs/system/doc/reference.html#Non- member-functions is that error_category.equivalent() is there to abstract this. operator== is overloaded on error_code and error_condition to perform that equivalence check, so this should do what you want:
catch (const basic_filesystem_error& e){ if (e == make_error_condition(posix_error::no_space_on_device)){ //... } }
Thanks, looks like this is what I need.