Compare commits

...

29 Commits

Author SHA1 Message Date
Daniel James 1da5d0d8fe Link to latest version of documentation
Putting 'release' instead of the version number will redirect to the latest documentation.
2018-03-05 18:23:34 +00:00
Fernando Cacciola 5a45a8d824 Merge pull request #9 from lakshayg/readme
add a short description and link to official docs
2018-02-27 18:14:45 -03:00
Lakshay Garg 3ae7d59e7a add a short description and link to official docs 2017-10-30 02:40:01 +05:30
Fernando Cacciola 54d571dde2 Merge pull request #7 from BlowaXD/fix-compiling
Fix compilation on lastest MSVC
2017-10-25 20:53:44 +02:00
Unknown 4505bc3808 Fix compilation on lastest MSVC
std::unary_function has been removed from C++ 17 standard so it does not compile anymore on MSVC
2017-09-27 12:39:34 +02:00
Brandon Kohn 7f3a74cb74 Merge pull request #6 from eldiener/develop
Removed executable attribute from file.
2017-09-23 18:42:25 -04:00
Edward Diener 278025d9c6 Removed executable attribute from file. 2017-09-17 10:46:51 -04:00
Brandon Kohn 7436ca7113 Merge-commit for hotfix/remove_std_unary_function. 2017-08-22 14:00:49 -04:00
Brandon Kohn ebfded1d7d Remove the deprecated uses of std::unary_function (again). 2017-08-22 13:39:34 -04:00
Brandon Kohn c9d7a49b4a Removed redundant typedefs for argument_type and result_type 2016-07-06 07:10:36 -04:00
Brandon Kohn 736745061d Merge branch 'hotfix/remove_std_unary_function' into develop 2016-07-05 21:40:31 -04:00
Brandon Kohn a6681748be Merged Jamfile.v2 test changes to conform to requirements. 2016-06-17 14:30:58 -04:00
Brandon Kohn 30d2e6d9f6 Revert "Modified Jamfile.v2 to conform to boost test requirements."
This reverts commit d76eb6fa72.
2016-06-17 14:20:27 -04:00
Brandon Kohn d76eb6fa72 Modified Jamfile.v2 to conform to boost test requirements. 2016-06-17 14:04:13 -04:00
brandon-kohn c90517da96 Merge pull request #3 from danieljames/metadata
Create metadata file.
2014-08-18 11:52:55 -04:00
Daniel James 907ae79790 Add metadata file. 2014-08-18 15:08:01 +01:00
Peter Dimov 86f8af551c Merge pull request #2 from apolukhin/develop
Moved cast.hpp file from Conversion library. It was decided that this fi...
2014-06-10 21:52:01 +03:00
Antony Polukhin cda4506afe Moved cast.hpp file from Conversion library. It was decided that this file must be in NumericCast library to reduce dependencies 2014-06-09 13:27:11 +04:00
brandon-kohn 718767f1e6 Merge pull request #1 from danieljames/develop
Remove old Visual C++ 6 workaround
2014-06-05 06:23:46 -04:00
Daniel James 69a46fea8a Remove old Visual C++ 6 workaround
From 41473987e5 - it was never released,
and Visual C++6 isn't supported anymore.
2014-06-02 10:11:42 +01:00
Daniel James 056045e503 Rebuild documentation.
Rebuilding documentation on develop and master to avoid unnecessary
differences.
2014-06-02 10:05:00 +01:00
Stephen Kelly d4a8c7049a Numeric: Remove obsolete MSVC version checks.
[SVN r86053]
2013-09-30 11:23:20 +00:00
Antony Polukhin 0fc4c240b9 Fixes #5731, fixes #5076, fixes #5393, fixes #5800
Now numeric_cast (and lexical_cast) can be compiled with disabled exceptions

[SVN r77234]
2012-03-05 17:11:20 +00:00
Brandon Kohn c9e3ffd511 Changed long long and unsigned long long to use the boost::(u)long_long_type typedefs in the numeric_cast_traits base specializations.
[SVN r76808]
2012-01-31 14:27:10 +00:00
Brandon Kohn e7b5847b5a Fixes for https://svn.boost.org/trac/boost/ticket/6158 numeric_cast_traits.
[SVN r76765]
2012-01-28 19:59:35 +00:00
Brandon Kohn 0ab23addef Replaced special copyright character with (c) in numeric cast traits files.
[SVN r74356]
2011-09-12 14:35:29 +00:00
Brandon Kohn 5d344f7463 Simplified custom numeric type in numeric_cast_traits_test.cpp to reduce template depth.
[SVN r73701]
2011-08-12 13:09:15 +00:00
Brandon Kohn 6bd888475f Changed numeric_cast_traits_test.cpp to explicitly use the boost namespace.
[SVN r73700]
2011-08-12 12:46:00 +00:00
Daniel James 4c8e454bbb Conversion: Fix preprocessor iteration.
Some preprocessors process all the 'elif' clauses even if it's known
that they're not going to be used which was resulting in errors.

[SVN r73691]
2011-08-12 06:55:07 +00:00
7 changed files with 32 additions and 45 deletions
+8
View File
@@ -0,0 +1,8 @@
# Boost.NumericConversion
The Boost Numeric Conversion library is a collection of tools to describe and perform conversions between values of different [numeric types][1].
The documentation for the library can be found [here][2]
[1]: http://www.boost.org/doc/libs/release/libs/numeric/conversion/doc/html/boost_numericconversion/definitions.html#boost_numericconversion.definitions.numeric_types
[2]: http://www.boost.org/doc/libs/release/libs/numeric/conversion/doc/html/index.html#numeric_conversion.overview
Executable → Regular
View File
+1 -1
View File
@@ -23,7 +23,7 @@
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
# include<boost/numeric/conversion/detail/old_numeric_cast.hpp>
@@ -21,13 +21,6 @@ template<class T, class S>
struct conversion_traits
: convdetail::get_conversion_traits<T,S>::type
{
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
typedef typename convdetail::get_conversion_traits<T,S>::type base_;
typedef typename base_::target_type target_type;
typedef typename base_::source_type source_type;
typedef typename base_::result_type result_type;
typedef typename base_::argument_type argument_type;
#endif
} ;
} } // namespace boost::numeric
@@ -12,6 +12,7 @@
#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"
@@ -450,7 +451,7 @@ namespace boost { namespace numeric { namespace convdetail
// Trivial Converter : used when (cv-unqualified) T == (cv-unqualified) S
//
template<class Traits>
struct trivial_converter_impl : public std::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
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>
@@ -471,7 +472,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 std::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
struct rounding_converter : public boost::functional::detail::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
,BOOST_DEDUCED_TYPENAME Traits::result_type
>
,public RangeChecker
@@ -501,7 +502,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 std::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
struct non_rounding_converter : public boost::functional::detail::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
,BOOST_DEDUCED_TYPENAME Traits::result_type
>
,public RangeChecker
+3 -34
View File
@@ -8,6 +8,8 @@
// See http://www.boost.org/libs/conversion for Documentation.
// Revision History
// 02 Jun 14 Remove VC6 workarounds.
// 16 Jul 11 Bugfixes for VC6.
// 23 JUN 05 Code extracted from /boost/cast.hpp into this new header.
// Keeps this legacy version of numeric_cast<> for old compilers
// wich can't compile the new version in /boost/numeric/conversion/cast.hpp
@@ -53,19 +55,6 @@
# include <boost/limits.hpp>
# include <boost/numeric/conversion/converter_policies.hpp>
// It has been demonstrated numerous times that MSVC 6.0 fails silently at link
// time if you use a template function which has template parameters that don't
// appear in the function's argument list.
//
// TODO: Add this to config.hpp?
// FLC: This macro is repeated in boost/cast.hpp but only locally (is undefined at the bottom)
// so is OK to reproduce it here.
# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
# define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
# else
# define BOOST_EXPLICIT_DEFAULT_TARGET
# endif
namespace boost
{
using numeric::bad_numeric_cast;
@@ -214,24 +203,6 @@ namespace boost
template <class X, class Y>
static inline bool check(X x, Y)
{ return x >= 0 && static_cast<X>(static_cast<Y>(x)) != x; }
# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
// MSVC6 can't static_cast unsigned __int64 -> floating types
# define BOOST_UINT64_CAST(src_type) \
static inline bool check(src_type x, unsigned __int64) \
{ \
if (x < 0) return false; \
unsigned __int64 y = static_cast<unsigned __int64>(x); \
bool odd = y & 0x1; \
__int64 div2 = static_cast<__int64>(y >> 1); \
return ((static_cast<src_type>(div2) * 2.0) + odd) != x; \
}
BOOST_UINT64_CAST(long double);
BOOST_UINT64_CAST(double);
BOOST_UINT64_CAST(float);
# undef BOOST_UINT64_CAST
# endif
};
template<>
@@ -285,7 +256,7 @@ namespace boost
#endif
template<typename Target, typename Source>
inline Target numeric_cast(Source arg BOOST_EXPLICIT_DEFAULT_TARGET)
inline Target numeric_cast(Source arg)
{
// typedefs abbreviating respective trait classes
typedef detail::fixed_numeric_limits<Source> arg_traits;
@@ -332,8 +303,6 @@ namespace boost
return static_cast<Target>(arg);
} // numeric_cast
# undef BOOST_EXPLICIT_DEFAULT_TARGET
} // namespace boost
#endif // BOOST_OLD_NUMERIC_CAST_HPP
+16
View File
@@ -0,0 +1,16 @@
{
"key": "numeric/conversion",
"name": "Numeric Conversion",
"authors": [
"Fernando Cacciola"
],
"description": "Optimized Policy-based Numeric Conversions.",
"category": [
"Math",
"Miscellaneous"
],
"maintainers": [
"Fernando Cacciola <fernando_cacciola -at- ciudad.com.ar>",
"Brandon Kohn <blkohn -at- hotmail.com>"
]
}