Boost logo

Boost Users :

Subject: Re: [Boost-users] [exception] array tags
From: Diederick C. Niehorster (dcnieho_at_[hidden])
Date: 2009-10-25 03:46:56


Hi Emil,

On Sun, Oct 25, 2009 at 3:06 PM, Emil Dotchevski
<emildotchevski_at_[hidden]> wrote:
> Or (if you throw std::out_of_range a lot) just derive from it and
> boost::exception, then you don't need to use enable_error_info:
>
> struct my_out_of_range: virtual std::out_of_range, virtual boost::exception { };
>
> BOOST_THROW_EXCEPTION(my_out_of_range() <<
> std_range_which(Rows()!=M.Rows()? "row" : "col");

This does not compile (on VS2008), giving me at call site:
error C2512: 'my_out_of_range::my_out_of_range' : no appropriate
default constructor available
I have tried adding a default constructor,
struct my_out_of_range: virtual std::out_of_range, virtual
boost::exception {my_out_of_range(){};};
but then i get the error:
error C2512: 'std::out_of_range::out_of_range' : no appropriate
default constructor available

I must be missing something painfully obvious here, but can't figure
it out. Do you know what is going wrong?

Best and thanks,
Diederick


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net