Ticket #2101: boost_variant_no_exceptions.diff

File boost_variant_no_exceptions.diff, 1.2 KB (added by anonymous, 14 years ago)
  • boost/variant/get.hpp

    diff -r 510d5bd079ad boost/variant/get.hpp
    a b  
    177177    U_ptr result = get<U>(&operand);
    178178
    179179    if (!result)
    180         throw bad_get();
     180        boost::throw_exception(bad_get());
    181181    return *result;
    182182}
    183183
     
    193193    U_ptr result = get<const U>(&operand);
    194194
    195195    if (!result)
    196         throw bad_get();
     196        boost::throw_exception(bad_get());
    197197    return *result;
    198198}
    199199
  • boost/variant/variant.hpp

    diff -r 510d5bd079ad boost/variant/variant.hpp
    a b  
    613613            // ...and attempt to copy rhs content into lhs storage:
    614614            new(lhs_.storage_.address()) RhsT(rhs_content_);
    615615        }
     616#ifndef BOOST_NO_EXCEPTIONS
    616617        catch (...)
    617618        {
    618619            // In case of failure, copy backup pointer to lhs storage...
     
    625626            // ...and rethrow:
    626627            throw;
    627628        }
     629#endif
    628630
    629631        // In case of success, indicate new content type...
    630632        lhs_.indicate_which(rhs_which_); // nothrow