Ticket #2093: boost_data_time_no_exceptions.diff

File boost_data_time_no_exceptions.diff, 2.4 KB (added by anonymous, 14 years ago)
  • boost/date_time/constrained_value.hpp

    diff -r 510d5bd079ad boost/date_time/constrained_value.hpp
    a b  
    1010 */
    1111
    1212#include <boost/config.hpp>
     13#include <boost/throw_exception.hpp>
    1314
    1415namespace boost {
    1516
     
    8485    static rep_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return max_value;};
    8586    static void on_error(rep_type, rep_type, violation_enum)
    8687    {
    87       throw exception_type();
     88        boost::throw_exception(exception_type());
    8889    }
    8990  };
    9091
  • boost/date_time/gregorian/conversion.hpp

    diff -r 510d5bd079ad boost/date_time/gregorian/conversion.hpp
    a b  
    2323#  include "boost/date_time/gregorian/gregorian_io.hpp"
    2424#endif // USE_DATE_TIME_PRE_1_33_FACET_IO
    2525
     26#include "boost/throw_exception.hpp"
     27
    2628namespace boost {
    2729
    2830namespace gregorian {
     
    3537    if(d.is_pos_infinity() || d.is_neg_infinity() || d.is_not_a_date()){
    3638#if defined(USE_DATE_TIME_PRE_1_33_FACET_IO)
    3739      std::string s("tm unable to handle date value of " + to_simple_string(d));
    38       throw std::out_of_range(s);
     40      boost::throw_exception(std::out_of_range(s));
    3941#else
    4042      std::stringstream ss;
    4143      ss << "tm unable to handle date value of " << d;
    42       throw std::out_of_range(ss.str());
     44      boost::throw_exception(std::out_of_range(ss.str()));
    4345#endif // USE_DATE_TIME_PRE_1_33_FACET_IO
    4446    }
    4547    std::tm datetm;
  • boost/date_time/gregorian/greg_date.hpp

    diff -r 510d5bd079ad boost/date_time/gregorian/greg_date.hpp
    a b  
    1313#include "boost/date_time/special_defs.hpp"
    1414#include "boost/date_time/gregorian/greg_calendar.hpp"
    1515#include "boost/date_time/gregorian/greg_duration.hpp"
     16
     17#include "boost/throw_exception.hpp"
    1618
    1719namespace boost {
    1820namespace gregorian {
     
    5557      : date_time::date<date, gregorian_calendar, date_duration>(y, m, d)
    5658    {
    5759      if (gregorian_calendar::end_of_month_day(y, m) < d) {
    58         throw bad_day_of_month(std::string("Day of month is not valid for year"));
     60          boost::throw_exception(bad_day_of_month(std::string("Day of month is not valid for year")));
    5961      }
    6062    }
    6163    //! Constructor from a ymd_type structure