mirror of
https://github.com/boostorg/numeric_conversion.git
synced 2026-07-23 13:54:15 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| de92292140 | |||
| 53de752e1f | |||
| 36f969a4c5 | |||
| b900379a74 | |||
| 8ad516370a | |||
| c993894676 |
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <typeinfo> // for std::bad_cast
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/no_tr1/cmath.hpp> // for std::floor and std::ceil
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
@@ -136,7 +137,7 @@ class bad_numeric_cast : public std::bad_cast
|
||||
{
|
||||
public:
|
||||
|
||||
virtual const char * what() const throw()
|
||||
virtual const char * what() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return "bad numeric conversion: overflow"; }
|
||||
};
|
||||
|
||||
@@ -144,14 +145,14 @@ class negative_overflow : public bad_numeric_cast
|
||||
{
|
||||
public:
|
||||
|
||||
virtual const char * what() const throw()
|
||||
virtual const char * what() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return "bad numeric conversion: negative overflow"; }
|
||||
};
|
||||
class positive_overflow : public bad_numeric_cast
|
||||
{
|
||||
public:
|
||||
|
||||
virtual const char * what() const throw()
|
||||
virtual const char * what() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return "bad numeric conversion: positive overflow"; }
|
||||
};
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "boost/functional.hpp"
|
||||
#include "boost/numeric/conversion/detail/meta.hpp"
|
||||
#include "boost/numeric/conversion/detail/conversion_traits.hpp"
|
||||
#include "boost/numeric/conversion/bounds.hpp"
|
||||
@@ -451,13 +450,10 @@ namespace boost { namespace numeric { namespace convdetail
|
||||
// Trivial Converter : used when (cv-unqualified) T == (cv-unqualified) S
|
||||
//
|
||||
template<class Traits>
|
||||
struct trivial_converter_impl : public boost::functional::detail::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
|
||||
,BOOST_DEDUCED_TYPENAME Traits::result_type
|
||||
>
|
||||
,public dummy_range_checker<Traits>
|
||||
struct trivial_converter_impl : public dummy_range_checker<Traits>
|
||||
{
|
||||
typedef Traits traits ;
|
||||
|
||||
|
||||
typedef typename Traits::source_type source_type ;
|
||||
typedef typename Traits::argument_type argument_type ;
|
||||
typedef typename Traits::result_type result_type ;
|
||||
@@ -472,10 +468,7 @@ namespace boost { namespace numeric { namespace convdetail
|
||||
// Rounding Converter : used for float to integral conversions.
|
||||
//
|
||||
template<class Traits,class RangeChecker,class RawConverter,class Float2IntRounder>
|
||||
struct rounding_converter : public boost::functional::detail::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
|
||||
,BOOST_DEDUCED_TYPENAME Traits::result_type
|
||||
>
|
||||
,public RangeChecker
|
||||
struct rounding_converter : public RangeChecker
|
||||
,public Float2IntRounder
|
||||
,public RawConverter
|
||||
{
|
||||
@@ -502,10 +495,7 @@ namespace boost { namespace numeric { namespace convdetail
|
||||
// Non-Rounding Converter : used for all other conversions.
|
||||
//
|
||||
template<class Traits,class RangeChecker,class RawConverter>
|
||||
struct non_rounding_converter : public boost::functional::detail::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
|
||||
,BOOST_DEDUCED_TYPENAME Traits::result_type
|
||||
>
|
||||
,public RangeChecker
|
||||
struct non_rounding_converter : public RangeChecker
|
||||
,public RawConverter
|
||||
{
|
||||
typedef RangeChecker RangeCheckerBase ;
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ project numeric_conversion_unit_tests
|
||||
test-suite minimal
|
||||
:
|
||||
[ run bounds_test.cpp ]
|
||||
[ run traits_test.cpp ]
|
||||
[ run traits_test.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run converter_test.cpp ]
|
||||
[ run udt_support_test.cpp ]
|
||||
[ run numeric_cast_test.cpp ]
|
||||
|
||||
Reference in New Issue
Block a user