Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualDemonRad

Posted 02 August 2013 - 12:46 PM

It sounds like a automatic-rethrow exception.

try{


}
catch(AllOrNothing by_value){
 // your interception code
 } 

// the magic class (this is just a draft

class AllOrNothing: public virtual std::exception{

public: 

    virtual ~AllOrNothing(){
        if(!flag)
            throw this->clone(~flag);
    }

};


when the catch block goes out of scope the argument is destroyed (if passed by value) and it throws. Of course it sets a flag when cloning so that it rethrows only once.


#2DemonRad

Posted 02 August 2013 - 12:33 PM

It sounds like a automatic-rethrow exception.

try{


}
catch(std::exception by_value){
 // your interception code
 } 

// the magic class (this is just a draft

class AllOrNothing: public virtual std::exception{

public: 

    virtual ~AllOrNothing(){
        if(!flag)
            throw this->clone(~flag);
    }

};


when the catch block goes out of scope the argument is destroyed (if passed by value) and it throws. Of course it sets a flag when cloning so that it rethrows only once.


#1DemonRad

Posted 02 August 2013 - 12:32 PM

It sounds like a automatic-rethrow exception.

try{


}
catch(std::exception by_value){
 // your interception code
 } 

// the magic class (this is just a draft

class AllOrNothing: public virtual std::exception{

public: 

    ~AllOrNothing(){
        if(!flag)
            throw this->clone(~flag);
    }

};


when the catch block goes out of scope the argument is destroyed (if passed by value) and it throws. Of course it sets a flag when cloning so that it rethrows only once.


PARTNERS