Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2005-05-06 07:39:16


"James Gregory" <james.jrg_at_[hidden]> wrote in message
news:beb51c260505051117392703d0_at_mail.gmail.com...
>> You are right that there is a clash. But it seems to me
>> std::runtime_error
>> should be the base class, so it is the implementation that is wrong.
>>
>> Comments?
>>
>> --Beman
>
> 1. The boost guidelines at
> http://www.boost.org/more/error_handling.html say "Derive your
> exception class from std::exception. Except in *very* rare
> circumstances where you can't afford the cost of a virtual table,
> std::exception makes a reasonable exception base class"
>
> 2. But runtime_error does derive from std::exception, and the error is
> a run time error

Yes, so in future versions I'll change the derivation to runtime_error.
Thanks for reporting this.

> 3. Whilst I'm here, I would also like to point out the following silly
> code I need to use boost filesystem for a program designed to run in
> Linux and Windows:
>
> #ifdef __linux__
> fs::path::default_name_check(fs::windows_name);
> #else //ie we are compiling for Windows
> fs::path::default_name_check(fs::native);
> #endif
>
> If I use fs::native at all times then I cannot use paths with spaces
> in under Linux, but if I use fs::windows_name at all times then I
> cannot use a colon to specify drive names in Windows (e.g. C:\).

That whole problem will disappear with the coming major revision, planned
for 1.34. The distinction between a native and portable path will not have
to be explicitly identified.

Cheers,

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk