Ticket #8717: boost_variant.patch

File boost_variant.patch, 5.4 KB (added by Adam Romanek <romanek.adam@…>, 9 years ago)
  • boost/variant/get.hpp

    diff -Naur .build/boost_1_53_0/boost/variant/get.hpp .build/boost_1_53_0_patched/boost/variant/get.hpp
    old new  
    1717
    1818#include "boost/config.hpp"
    1919#include "boost/detail/workaround.hpp"
     20#include "boost/throw_exception.hpp"
    2021#include "boost/utility/addressof.hpp"
    2122#include "boost/variant/variant_fwd.hpp"
    2223
     
    177178    U_ptr result = get<U>(&operand);
    178179
    179180    if (!result)
    180         throw bad_get();
     181        throw_exception(bad_get());
    181182    return *result;
    182183}
    183184
     
    193194    U_ptr result = get<const U>(&operand);
    194195
    195196    if (!result)
    196         throw bad_get();
     197        throw_exception(bad_get());
    197198    return *result;
    198199}
    199200
  • boost/variant/variant.hpp

    diff -Naur .build/boost_1_53_0/boost/variant/variant.hpp .build/boost_1_53_0_patched/boost/variant/variant.hpp
    old new  
    3838#include "boost/variant/detail/has_nothrow_move.hpp"
    3939#include "boost/variant/detail/move.hpp"
    4040
     41#include "boost/detail/no_exceptions_support.hpp"
    4142#include "boost/detail/reference_content.hpp"
    4243#include "boost/aligned_storage.hpp"
    4344#include "boost/blank.hpp"
     
    770771        // ...destroy lhs content...
    771772        lhs_content.~LhsT(); // nothrow
    772773
    773         try
     774        BOOST_TRY
    774775        {
    775776            // ...and attempt to copy rhs content into lhs storage:
    776777            copy_rhs_content_(lhs_.storage_.address(), rhs_content_);
    777778        }
    778         catch (...)
     779        BOOST_CATCH (...)
    779780        {
    780781            // In case of failure, restore backup content to lhs storage...
    781782            new(lhs_.storage_.address())
     
    784785                    ); // nothrow
    785786
    786787            // ...and rethrow:
    787             throw;
     788            BOOST_RETHROW
    788789        }
     790        BOOST_CATCH_END
    789791
    790792        // In case of success, indicate new content type:
    791793        lhs_.indicate_which(rhs_which_); // nothrow
     
    803805        // ...destroy lhs content...
    804806        lhs_content.~LhsT(); // nothrow
    805807
    806         try
     808        BOOST_TRY
    807809        {
    808810            // ...and attempt to copy rhs content into lhs storage:
    809811            copy_rhs_content_(lhs_.storage_.address(), rhs_content_);
    810812        }
    811         catch (...)
     813        BOOST_CATCH (...)
    812814        {
    813815            // In case of failure, copy backup pointer to lhs storage...
    814816            new(lhs_.storage_.address())
     
    818820            lhs_.indicate_backup_which( lhs_.which() ); // nothrow
    819821
    820822            // ...and rethrow:
    821             throw;
     823            BOOST_RETHROW
    822824        }
     825        BOOST_CATCH_END
    823826
    824827        // In case of success, indicate new content type...
    825828        lhs_.indicate_which(rhs_which_); // nothrow
     
    18601863            // Destroy lhs's content...
    18611864            lhs_.destroy_content(); // nothrow
    18621865
    1863             try
     1866            BOOST_TRY
    18641867            {
    18651868                // ...and attempt to copy rhs's content into lhs's storage:
    18661869                new(lhs_.storage_.address())
    18671870                    RhsT( rhs_content );
    18681871            }
    1869             catch (...)
     1872            BOOST_CATCH (...)
    18701873            {
    18711874                // In case of failure, default-construct fallback type in lhs's storage...
    18721875                new (lhs_.storage_.address())
     
    18781881                    ); // nothrow
    18791882
    18801883                // ...and rethrow:
    1881                 throw;
     1884                BOOST_RETHROW
    18821885            }
     1886            BOOST_CATCH_END
    18831887
    18841888            // In the event of success, indicate new content type:
    18851889            lhs_.indicate_which(rhs_which_); // nothrow
     
    20042008            // Destroy lhs's content...
    20052009            lhs_.destroy_content(); // nothrow
    20062010
    2007             try
     2011            BOOST_TRY
    20082012            {
    20092013                // ...and attempt to copy rhs's content into lhs's storage:
    20102014                new(lhs_.storage_.address())
    20112015                    RhsT( detail::variant::move(rhs_content) );
    20122016            }
    2013             catch (...)
     2017            BOOST_CATCH (...)
    20142018            {
    20152019                // In case of failure, default-construct fallback type in lhs's storage...
    20162020                new (lhs_.storage_.address())
     
    20222026                    ); // nothrow
    20232027
    20242028                // ...and rethrow:
    2025                 throw;
     2029                BOOST_RETHROW
    20262030            }
     2031            BOOST_CATCH_END
    20272032
    20282033            // In the event of success, indicate new content type:
    20292034            lhs_.indicate_which(rhs_which_); // nothrow
  • boost/variant/visitor_ptr.hpp

    diff -Naur .build/boost_1_53_0/boost/variant/visitor_ptr.hpp .build/boost_1_53_0_patched/boost/variant/visitor_ptr.hpp
    old new  
    1818
    1919#include "boost/mpl/eval_if.hpp"
    2020#include "boost/mpl/identity.hpp"
     21#include "boost/throw_exception.hpp"
    2122#include "boost/type_traits/add_reference.hpp"
    2223#include "boost/type_traits/is_reference.hpp"
    2324#include "boost/type_traits/is_void.hpp"
     
    6465    template <typename U>
    6566    result_type operator()(const U&) const
    6667    {
    67         throw bad_visit();
     68        throw_exception(bad_visit());
    6869    }
    6970
    7071#if !defined(BOOST_NO_VOID_RETURNS)