mirror of
https://github.com/boostorg/convert.git
synced 2026-01-19 04:02:18 +00:00
15APR-12:53 trying to support older compilers
This commit is contained in:
@@ -180,7 +180,7 @@ struct boost::cnv::cnvbase
|
||||
|
||||
// ULONG_MAX(8 bytes) = 18446744073709551615 (20(10) or 32(2) characters)
|
||||
// double (8 bytes) max is 316 chars
|
||||
static int inline constexpr bufsize_ = 512;
|
||||
static int BOOST_CONSTEXPR_OR_CONST bufsize_ = 512;
|
||||
|
||||
bool skipws_ = false;
|
||||
int precision_ = 0;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#endif
|
||||
|
||||
// No C++11 support
|
||||
#if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION <= 40600)
|
||||
#if defined(__GNUC__) && (__GNUC__ < 6)
|
||||
# define BOOST_CONVERT_IS_NOT_SUPPORTED
|
||||
#endif
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ class __trait_name__
|
||||
{ \
|
||||
using a1 = typename boost::decay<Arg1>::type*; \
|
||||
\
|
||||
static bool constexpr value = \
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = \
|
||||
sizeof(boost::type_traits::yes_type) == \
|
||||
sizeof(boost::cnv::detail::redirect<class_type, R>::test( \
|
||||
(mixin_ptr(0)->__member_name__(*a1(0)), \
|
||||
@@ -85,7 +85,7 @@ class __trait_name__
|
||||
using a1 = typename boost::decay<Arg1>::type*; \
|
||||
using a2 = typename boost::decay<Arg2>::type*; \
|
||||
\
|
||||
static bool constexpr value = \
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = \
|
||||
sizeof(boost::type_traits::yes_type) == \
|
||||
sizeof(boost::cnv::detail::redirect<class_type, R>::test( \
|
||||
(mixin_ptr(0)->__member_name__(*a1(0), *a2(0)), \
|
||||
@@ -95,7 +95,7 @@ class __trait_name__
|
||||
public: \
|
||||
\
|
||||
/* Check the existence of __member_name__ first, then the signature. */ \
|
||||
static bool constexpr value = check<has_member<class_type>::value, signature>::value; \
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = check<has_member<class_type>::value, signature>::value; \
|
||||
}
|
||||
|
||||
#endif // BOOST_CONVERT_IS_CALLABLE_HPP
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace boost::cnv
|
||||
static yes_type test (TypeOut const&);
|
||||
static no_type test (...);
|
||||
|
||||
static bool constexpr value = sizeof(yes_type) == sizeof(test(((Functor*) 0)->operator()()));
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = sizeof(yes_type) == sizeof(test(((Functor*) 0)->operator()()));
|
||||
};
|
||||
template<typename Functor, typename TypeOut>
|
||||
struct is_fun<Functor, TypeOut,
|
||||
|
||||
@@ -15,15 +15,15 @@ namespace boost::cnv
|
||||
|
||||
template<typename T> struct is_string<T*, false>
|
||||
{
|
||||
static bool constexpr value = cnv::is_char<T>::value;
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = cnv::is_char<T>::value;
|
||||
};
|
||||
template <typename T, std::size_t N> struct is_string<T [N], false>
|
||||
{
|
||||
static bool constexpr value = cnv::is_char<T>::value;
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = cnv::is_char<T>::value;
|
||||
};
|
||||
template<typename T> struct is_string<T, /*is_range_class=*/true>
|
||||
{
|
||||
static bool constexpr value = cnv::is_char<typename T::value_type>::value;
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = cnv::is_char<typename T::value_type>::value;
|
||||
};
|
||||
}
|
||||
template<typename T>
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace boost::cnv
|
||||
BOOST_DECLARE_HAS_MEMBER(has_begin, begin);
|
||||
BOOST_DECLARE_HAS_MEMBER( has_end, end);
|
||||
|
||||
static bool constexpr value = has_begin<T>::value && has_end<T>::value;
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = has_begin<T>::value && has_end<T>::value;
|
||||
};
|
||||
}
|
||||
template<typename T> struct is_range : detail::is_range<typename boost::remove_const<T>::type, boost::is_class<T>::value> {};
|
||||
|
||||
@@ -59,19 +59,19 @@ struct boost::cnv::printf : boost::cnv::cnvbase<boost::cnv::printf>
|
||||
}
|
||||
char_cptr printf_format(int type_pos) const
|
||||
{
|
||||
char_cptr constexpr d_fmt[3][8] =
|
||||
char_cptr BOOST_CONSTEXPR_OR_CONST d_fmt[3][8] =
|
||||
{
|
||||
{ "%.*f", "%.*f", "%.*d", "%.*u", "%.*hd", "%.*hu", "%.*ld", "%.*lu" }, //C1. fxd
|
||||
{ "%.*e", "%.*e", "%.*d", "%.*u", "%.*hd", "%.*hu", "%.*ld", "%.*lu" }, //C1. sci
|
||||
{ "%.*a", "%.*a", "%.*d", "%.*u", "%.*hd", "%.*hu", "%.*ld", "%.*lu" } //C1. hex
|
||||
};
|
||||
char_cptr constexpr x_fmt[3][8] =
|
||||
char_cptr BOOST_CONSTEXPR_OR_CONST x_fmt[3][8] =
|
||||
{
|
||||
{ "%.*f", "%.*f", "%.*x", "%.*x", "%.*hx", "%.*hx", "%.*lx", "%.*lx" }, //C1. fxd
|
||||
{ "%.*e", "%.*e", "%.*x", "%.*x", "%.*hx", "%.*hx", "%.*lx", "%.*lx" }, //C1. sci
|
||||
{ "%.*a", "%.*a", "%.*x", "%.*x", "%.*hx", "%.*hx", "%.*lx", "%.*lx" } //C1. hex
|
||||
};
|
||||
char_cptr constexpr o_fmt[3][8] =
|
||||
char_cptr BOOST_CONSTEXPR_OR_CONST o_fmt[3][8] =
|
||||
{
|
||||
{ "%.*f", "%.*f", "%.*o", "%.*o", "%.*ho", "%.*ho", "%.*lo", "%.*lo" }, //C1. fxd
|
||||
{ "%.*e", "%.*e", "%.*o", "%.*o", "%.*ho", "%.*ho", "%.*lo", "%.*lo" }, //C1. sci
|
||||
@@ -84,19 +84,19 @@ struct boost::cnv::printf : boost::cnv::cnvbase<boost::cnv::printf>
|
||||
}
|
||||
char_cptr sscanf_format(int type_pos) const
|
||||
{
|
||||
char_cptr constexpr d_fmt[3][8] =
|
||||
char_cptr BOOST_CONSTEXPR_OR_CONST d_fmt[3][8] =
|
||||
{
|
||||
{ "%lf", "%f", "%d", "%u", "%hd", "%hu", "%ld", "%lu" }, //C1. fxd
|
||||
{ "%le", "%e", "%d", "%u", "%hd", "%hu", "%ld", "%lu" }, //C1. sci
|
||||
{ "%la", "%a", "%d", "%u", "%hd", "%hu", "%ld", "%lu" } //C1. hex
|
||||
};
|
||||
char_cptr constexpr x_fmt[3][8] =
|
||||
char_cptr BOOST_CONSTEXPR_OR_CONST x_fmt[3][8] =
|
||||
{
|
||||
{ "%lf", "%f", "%x", "%x", "%hx", "%hx", "%lx", "%lx" }, //C1. fxd
|
||||
{ "%le", "%e", "%x", "%x", "%hx", "%hx", "%lx", "%lx" }, //C1. sci
|
||||
{ "%la", "%a", "%x", "%x", "%hx", "%hx", "%lx", "%lx" } //C1. hex
|
||||
};
|
||||
char_cptr constexpr o_fmt[3][8] =
|
||||
char_cptr BOOST_CONSTEXPR_OR_CONST o_fmt[3][8] =
|
||||
{
|
||||
{ "%lf", "%f", "%o", "%o", "%ho", "%ho", "%lo", "%lo" }, //C1. fxd
|
||||
{ "%le", "%e", "%o", "%o", "%ho", "%ho", "%lo", "%lo" }, //C1. sci
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace { namespace local
|
||||
};
|
||||
template<typename T> static typename array<T>::type const& get();
|
||||
|
||||
int constexpr num_cycles = 1000000;
|
||||
int BOOST_CONSTEXPR_OR_CONST num_cycles = 1000000;
|
||||
int sum = 0;
|
||||
|
||||
struct timer : boost::timer::cpu_timer
|
||||
|
||||
Reference in New Issue
Block a user