Boost logo

Boost Users :

Subject: Re: [Boost-users] lambda::throw_exception fails
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-06-16 18:39:04


AMDG

KessiMC wrote:
> Be it that this code is working:
>
> try {
> throw InterfaceTimeoutException();
> } catch (const std::exception &ex) {
> cout << ex.what() << endl;
> }
>
> However, trying this:
>
> try {
> lambda::throw_exception(constructor<InterfaceTimeoutException> ())();
> } catch (const std::exception &ex) {
> cout << ex.what() << endl;
> }
>
> ends up with my programm crashing (Exit code 3).
>
> What am I missing here?
>

constructor must be used with bind.
lambda::throw_exception(lambda::bind(
    lambda::constructor<InterfaceTimeoutException>()))();

In Christ,
Steven Watanabe


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