Boost logo

Boost :

From: James Gregory (james.jrg_at_[hidden])
Date: 2005-05-05 13:17:47


> 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

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:\).

James


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