diff --git a/sprout/bitset/bitset.hpp b/sprout/bitset/bitset.hpp index e00dd8b3..499b73bf 100644 --- a/sprout/bitset/bitset.hpp +++ b/sprout/bitset/bitset.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -519,7 +520,7 @@ namespace sprout { {} base_bitset(base_bitset<1> const&) = default; SPROUT_CONSTEXPR base_bitset(unsigned long long val) SPROUT_NOEXCEPT - : w_(val) + : w_(static_cast(val)) {} SPROUT_CONSTEXPR base_bitset(sprout::detail::base_bitset_from_words_construct_tag, word_type word) : w_(word) @@ -728,8 +729,8 @@ namespace sprout { SPROUT_CXX14_CONSTEXPR word_type getword(size_type, bool c = false) SPROUT_NOEXCEPT { - return !c ? 0 - : throw std::out_of_range("base_bitset::getword") + return SPROUT_ASSERT_MSG(!c, "base_bitset::getword"), + 0 ; } SPROUT_CONSTEXPR word_type diff --git a/sprout/checksum/md5.hpp b/sprout/checksum/md5.hpp index 71bf8c10..b190863d 100644 --- a/sprout/checksum/md5.hpp +++ b/sprout/checksum/md5.hpp @@ -116,13 +116,13 @@ namespace sprout { SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SS) \ ; \ }; \ - SPROUT_CONSTEXPR_OR_CONST typename sprout::md5_detail::round_table::xis_type sprout::md5_detail::round_table::xis \ + SPROUT_CONSTEXPR_OR_CONST sprout::md5_detail::round_table::xis_type sprout::md5_detail::round_table::xis \ SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(XIS) \ ; \ - SPROUT_CONSTEXPR_OR_CONST typename sprout::md5_detail::round_table::ts_type sprout::md5_detail::round_table::ts \ + SPROUT_CONSTEXPR_OR_CONST sprout::md5_detail::round_table::ts_type sprout::md5_detail::round_table::ts \ SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(TS) \ ; \ - SPROUT_CONSTEXPR_OR_CONST typename sprout::md5_detail::round_table::ss_type sprout::md5_detail::round_table::ss \ + SPROUT_CONSTEXPR_OR_CONST sprout::md5_detail::round_table::ss_type sprout::md5_detail::round_table::ss \ SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SS) SPROUT_MD5_DETAIL_ROUND_TABLE_DEF( \ @@ -251,7 +251,7 @@ namespace sprout { ) const { return bit_count % (64 * 8) != 0 ? const_type(k, block, bit_count) - : const_type(k, block, bit_count).process_block() + : const_type(k, block, bit_count).c_process_block() ; } SPROUT_CONSTEXPR md5 const process_block_1(sprout::array const& x) const { @@ -263,6 +263,9 @@ namespace sprout { SPROUT_CONSTEXPR md5 const process_block() const { return process_block_1(sprout::md5_detail::round_all(k_, block_)); } + SPROUT_CONSTEXPR md5 const c_process_block() const { + return process_block_1(sprout::md5_detail::round_all(k_, block_)); + } SPROUT_CONSTEXPR md5 const process_bit_impl(bool bit, std::size_t index, std::size_t offset) const { return process( k_, diff --git a/sprout/checksum/sha1.hpp b/sprout/checksum/sha1.hpp index b5fe82c0..40ec4f78 100644 --- a/sprout/checksum/sha1.hpp +++ b/sprout/checksum/sha1.hpp @@ -218,7 +218,7 @@ namespace sprout { { return block_byte_index != 64 ? const_type(h, block, block_byte_index, bit_count) - : const_type(h, block, 0, bit_count).process_block() + : const_type(h, block, 0, bit_count).c_process_block() ; } SPROUT_CONSTEXPR sha1 const process_block_2( @@ -265,6 +265,9 @@ namespace sprout { SPROUT_CONSTEXPR sha1 const process_block() const { return process_block_1(h_[0], h_[1], h_[2], h_[3], h_[4]); } + SPROUT_CONSTEXPR sha1 const c_process_block() const { + return process_block_1(h_[0], h_[1], h_[2], h_[3], h_[4]); + } template SPROUT_CONSTEXPR typename std::enable_if::type process_block_impl(InputIterator first, InputIterator last, Args... args) const { diff --git a/sprout/complex/udl.hpp b/sprout/complex/udl.hpp index cc41be8b..4cdbac7a 100644 --- a/sprout/complex/udl.hpp +++ b/sprout/complex/udl.hpp @@ -30,11 +30,11 @@ namespace sprout { // inline SPROUT_CONSTEXPR sprout::complex operator"" _if(long double x) { - return sprout::complex(0, x); + return sprout::complex(0, static_cast(x)); } inline SPROUT_CONSTEXPR sprout::complex operator"" _iF(long double x) { - return sprout::complex(0, x); + return sprout::complex(0, static_cast(x)); } // diff --git a/sprout/container/container_range_traits.hpp b/sprout/container/container_range_traits.hpp index c1bda2df..287c2ae5 100644 --- a/sprout/container/container_range_traits.hpp +++ b/sprout/container/container_range_traits.hpp @@ -37,7 +37,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_mem_size : public Base_ @@ -84,7 +84,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_mem_empty : public Base_ @@ -131,7 +131,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_mem_front : public Base_ @@ -203,7 +203,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_mem_back : public Base_ @@ -275,7 +275,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_mem_at : public Base_ @@ -347,7 +347,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_mem_nth : public Base_ @@ -419,7 +419,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_mem_index_of : public Base_ diff --git a/sprout/container/deep_internal.hpp b/sprout/container/deep_internal.hpp index 23b7f7ed..020c9bc2 100644 --- a/sprout/container/deep_internal.hpp +++ b/sprout/container/deep_internal.hpp @@ -17,7 +17,12 @@ namespace sprout { namespace containers { namespace detail { template - struct deep_internal_impl + struct deep_internal_impl; + template + struct deep_internal_impl< + Container, Prev, + typename std::enable_if::value>::type + > : public sprout::containers::detail::deep_internal_impl< typename sprout::containers::internal::type, Container > diff --git a/sprout/container/shrink_to_fit.hpp b/sprout/container/shrink_to_fit.hpp index badc806f..f981dba8 100644 --- a/sprout/container/shrink_to_fit.hpp +++ b/sprout/container/shrink_to_fit.hpp @@ -32,7 +32,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_mem_shrink_to_fit : public Base_ diff --git a/sprout/container/weak_rebind_size.hpp b/sprout/container/weak_rebind_size.hpp index 7f205cba..5a709b8d 100644 --- a/sprout/container/weak_rebind_size.hpp +++ b/sprout/container/weak_rebind_size.hpp @@ -24,7 +24,7 @@ namespace sprout { sprout::true_type sprout_has_xxx_impl_check_template_rebind_size(int); template sprout::false_type sprout_has_xxx_impl_check_template_rebind_size(long); -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template(0))> struct has_rebind_size : public Base_ diff --git a/sprout/ctype/ascii.hpp b/sprout/ctype/ascii.hpp index 2e19e228..1f67eabe 100644 --- a/sprout/ctype/ascii.hpp +++ b/sprout/ctype/ascii.hpp @@ -192,51 +192,51 @@ namespace sprout { #define SPROUT_CTYPE_ASCII_DECL(CHAR_TYPE, PREFIX) \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, alnum))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & (sprout::ascii::detail::alpha | sprout::ascii::detail::digit); \ + return (sprout::ascii::detail::get_value(c) & (sprout::ascii::detail::alpha | sprout::ascii::detail::digit)) != 0; \ } \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, alpha))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::alpha; \ + return (sprout::ascii::detail::get_value(c) & sprout::ascii::detail::alpha) != 0; \ } \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, blank))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::blank; \ + return (sprout::ascii::detail::get_value(c) & sprout::ascii::detail::blank) != 0; \ } \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, cntrl))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::cntrl; \ + return (sprout::ascii::detail::get_value(c) & sprout::ascii::detail::cntrl) != 0; \ } \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, digit))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::digit; \ + return (sprout::ascii::detail::get_value(c) & sprout::ascii::detail::digit) != 0; \ } \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, graph))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::graph; \ + return (sprout::ascii::detail::get_value(c) & sprout::ascii::detail::graph) != 0; \ } \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, lower))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::lower; \ + return (sprout::ascii::detail::get_value(c) & sprout::ascii::detail::lower) != 0; \ } \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, print))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::print; \ + return (sprout::ascii::detail::get_value(c) & sprout::ascii::detail::print) != 0; \ } \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, punct))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::punct; \ + return (sprout::ascii::detail::get_value(c) & sprout::ascii::detail::punct) != 0; \ } \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, space))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::space; \ + return (sprout::ascii::detail::get_value(c) & sprout::ascii::detail::space) != 0; \ } \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, upper))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::upper; \ + return (sprout::ascii::detail::get_value(c) & sprout::ascii::detail::upper) != 0; \ } \ inline SPROUT_CONSTEXPR bool \ SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, xdigit))(CHAR_TYPE c) { \ - return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::xdigit; \ + return (sprout::ascii::detail::get_value(c) & sprout::ascii::detail::xdigit) != 0; \ } \ inline SPROUT_CONSTEXPR CHAR_TYPE \ SPROUT_PP_CAT(to, SPROUT_PP_CAT(PREFIX, lower))(CHAR_TYPE c) { \ diff --git a/sprout/detail/integer.hpp b/sprout/detail/integer.hpp index 49f48c2e..9bbe7bbc 100644 --- a/sprout/detail/integer.hpp +++ b/sprout/detail/integer.hpp @@ -174,11 +174,11 @@ namespace sprout { struct uint_value_t { typedef typename sprout::detail::int_least_helper< 5 - + (MaxValue <= sprout::numeric_limits::max()) - + (MaxValue <= sprout::numeric_limits::max()) - + (MaxValue <= sprout::numeric_limits::max()) - + (MaxValue <= sprout::numeric_limits::max()) - + (MaxValue <= sprout::numeric_limits::max()) + + (MaxValue <= static_cast(sprout::numeric_limits::max())) + + (MaxValue <= static_cast(sprout::numeric_limits::max())) + + (MaxValue <= static_cast(sprout::numeric_limits::max())) + + (MaxValue <= static_cast(sprout::numeric_limits::max())) + + (MaxValue <= static_cast(sprout::numeric_limits::max())) >::least least; typedef typename sprout::detail::int_fast_t::type fast; }; diff --git a/sprout/detail/integer/integer_mask.hpp b/sprout/detail/integer/integer_mask.hpp index d22a4c2b..db54033d 100644 --- a/sprout/detail/integer/integer_mask.hpp +++ b/sprout/detail/integer/integer_mask.hpp @@ -43,8 +43,8 @@ namespace sprout { struct low_bits_mask_t::digits> { \ public: \ typedef sprout::numeric_limits limits_type; \ - typedef typename sprout::detail::uint_t::least least; \ - typedef typename sprout::detail::uint_t::fast fast; \ + typedef sprout::detail::uint_t::least least; \ + typedef sprout::detail::uint_t::fast fast; \ public: \ SPROUT_STATIC_CONSTEXPR least sig_bits = ~(least(0u)); \ SPROUT_STATIC_CONSTEXPR fast sig_bits_fast = fast(sig_bits); \ diff --git a/sprout/detail/math/int.hpp b/sprout/detail/math/int.hpp index 5e9179a7..701c504d 100644 --- a/sprout/detail/math/int.hpp +++ b/sprout/detail/math/int.hpp @@ -16,6 +16,30 @@ namespace sprout { namespace detail { + // + // int_digits_mf + // + template + struct int_digits_mf_impl; + template + struct int_digits_mf_impl + : public sprout::integral_constant + {}; + template + struct int_digits_mf_impl + : public sprout::integral_constant::value> + {}; + template + struct int_digits_mf; + template + struct int_digits_mf + : public sprout::integral_constant + {}; + template + struct int_digits_mf + : public sprout::integral_constant::value> + {}; + // // int_pow // diff --git a/sprout/detail/predef.hpp b/sprout/detail/predef.hpp index 3b4e5890..3105ffe1 100644 --- a/sprout/detail/predef.hpp +++ b/sprout/detail/predef.hpp @@ -9,17 +9,7 @@ #define SPROUT_DETAIL_PREDEF_HPP #include - -// -// SPROUT_VERSION_NUMBER -// -#define SPROUT_VERSION_NUMBER(MAJOR, MINOR, PATCH) \ - ((((MAJOR) % 100) * 10000000) + (((MINOR) % 100) * 100000) + ((PATCH) % 100000)) -// -// SPROUT_VERSION_NUMBER_ZERO -// -#define SPROUT_VERSION_NUMBER_ZERO \ - SPROUT_VERSION_NUMBER(0, 0, 0) +#include // // SPROUT_AVAILABLE_GCC diff --git a/sprout/functional/mem_fn.hpp b/sprout/functional/mem_fn.hpp index c223c06b..afb659b5 100644 --- a/sprout/functional/mem_fn.hpp +++ b/sprout/functional/mem_fn.hpp @@ -13,6 +13,7 @@ #include #include #include +#include namespace sprout { // 20.8.10 member function adaptors @@ -200,13 +201,13 @@ namespace sprout { template static two check_const(T&, Class const*); template - static two check_const(T&, const volatile void*); + static two check_const(T&, void const volatile*); public: template struct result_type : public sprout::detail::mem_fn_const_or_non< Res, - (sizeof(two) == sizeof(check_const(get_ref(), (T*)0))) + (sizeof(two) == sizeof(check_const(get_ref(), sprout::identity::type()))) > {}; template diff --git a/sprout/functional/type_traits/weak_result_type.hpp b/sprout/functional/type_traits/weak_result_type.hpp index 423d9800..bf9fb5b4 100644 --- a/sprout/functional/type_traits/weak_result_type.hpp +++ b/sprout/functional/type_traits/weak_result_type.hpp @@ -41,41 +41,49 @@ namespace sprout { public: typedef R result_type; }; +#if !defined(_MSC_VER) template struct weak_result_type_impl { public: typedef R result_type; }; +#endif template struct weak_result_type_impl { public: typedef R result_type; }; +#if !defined(_MSC_VER) template struct weak_result_type_impl { public: typedef R result_type; }; +#endif template struct weak_result_type_impl { public: typedef R result_type; }; +#if !defined(_MSC_VER) template struct weak_result_type_impl { public: typedef R result_type; }; +#endif template struct weak_result_type_impl { public: typedef R result_type; }; +#if !defined(_MSC_VER) template struct weak_result_type_impl { public: typedef R result_type; }; +#endif #if SPROUT_CLANG_OR_LATER(3, 6, 0) # pragma clang diagnostic pop #endif diff --git a/sprout/generator/generator_access_traits.hpp b/sprout/generator/generator_access_traits.hpp index 415c1abb..42096e00 100644 --- a/sprout/generator/generator_access_traits.hpp +++ b/sprout/generator/generator_access_traits.hpp @@ -28,7 +28,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_mem_generated_value : public Base_ @@ -103,7 +103,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_mem_next_generator : public Base_ diff --git a/sprout/iterator/generator_iterator.hpp b/sprout/iterator/generator_iterator.hpp index e42bc6b5..723b0285 100644 --- a/sprout/iterator/generator_iterator.hpp +++ b/sprout/iterator/generator_iterator.hpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace sprout { // @@ -34,7 +35,7 @@ namespace sprout { public: typedef Generator generator_type; typedef std::forward_iterator_tag iterator_category; - typedef decltype(sprout::generators::generated_value(std::declval())) reference; + typedef typename sprout::identity()))>::type reference; typedef typename std::remove_reference::type value_type; typedef std::ptrdiff_t difference_type; typedef value_type* pointer; diff --git a/sprout/math/bernoulli.hpp b/sprout/math/bernoulli.hpp index fc46e529..68e9723d 100644 --- a/sprout/math/bernoulli.hpp +++ b/sprout/math/bernoulli.hpp @@ -178,7 +178,7 @@ namespace sprout { SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_BERNOULLI_TABLE_DEF_FLOAT) ; }; - SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers< + SPROUT_CONSTEXPR_OR_CONST sprout::math::detail::bernoulli_numbers< float >::table_type sprout::math::detail::bernoulli_numbers< float @@ -197,7 +197,7 @@ namespace sprout { SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_BERNOULLI_TABLE_DEF_DOUBLE) ; }; - SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers< + SPROUT_CONSTEXPR_OR_CONST sprout::math::detail::bernoulli_numbers< double >::table_type sprout::math::detail::bernoulli_numbers< double @@ -216,7 +216,7 @@ namespace sprout { SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_BERNOULLI_TABLE_DEF_LONG_DOUBLE) ; }; - SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers< + SPROUT_CONSTEXPR_OR_CONST sprout::math::detail::bernoulli_numbers< long double >::table_type sprout::math::detail::bernoulli_numbers< long double diff --git a/sprout/memory/addressof.hpp b/sprout/memory/addressof.hpp index 6442fe64..c1666f67 100644 --- a/sprout/memory/addressof.hpp +++ b/sprout/memory/addressof.hpp @@ -31,7 +31,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_mem_address_op : public Base_ @@ -53,7 +53,7 @@ namespace sprout { static sprout::true_type test(int); static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template::test(0))>::type> struct has_nonmem_address_op : public Base_ diff --git a/sprout/net/endian.hpp b/sprout/net/endian.hpp index 36976254..f5173f5d 100644 --- a/sprout/net/endian.hpp +++ b/sprout/net/endian.hpp @@ -54,9 +54,11 @@ namespace sprout { * Get 'n'th byte from 'val' */ template - inline SPROUT_CONSTEXPR T + inline SPROUT_CONSTEXPR std::uint_fast8_t byte_at(T val, std::uint_fast8_t n) { - return sprout::net::detail::rshift_by((val & sprout::net::detail::mask_at(n)), n); + return static_cast( + sprout::net::detail::rshift_by((val & sprout::net::detail::mask_at(n)), n) + ); } /* @@ -96,7 +98,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR T reverse_impl(T val, std::uint_fast8_t n1, std::uint_fast8_t n2) { - return n1 > n2 ? val : sprout::net::detail::reverse_impl(swap(val, n1, n2), n1 + 1, n2 - 1); + return n1 > n2 ? val : sprout::net::detail::reverse_impl(sprout::net::detail::swap(val, n1, n2), n1 + 1, n2 - 1); } /* diff --git a/sprout/rational/udl.hpp b/sprout/rational/udl.hpp index 5818779c..f6a45ac2 100644 --- a/sprout/rational/udl.hpp +++ b/sprout/rational/udl.hpp @@ -21,7 +21,7 @@ namespace sprout { // inline SPROUT_CONSTEXPR sprout::rational operator"" _r(unsigned long long x) { - return sprout::rational(x); + return sprout::rational(static_cast(x)); } // @@ -30,11 +30,11 @@ namespace sprout { // inline SPROUT_CONSTEXPR sprout::rational operator"" _rl(unsigned long long x) { - return sprout::rational(x); + return sprout::rational(static_cast(x)); } inline SPROUT_CONSTEXPR sprout::rational operator"" _rL(unsigned long long x) { - return sprout::rational(x); + return sprout::rational(static_cast(x)); } // diff --git a/sprout/string/float_to_string.hpp b/sprout/string/float_to_string.hpp index 20f08b06..786ac205 100644 --- a/sprout/string/float_to_string.hpp +++ b/sprout/string/float_to_string.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -108,7 +109,7 @@ namespace sprout { struct printed_float_exponent10_digits : public sprout::integral_constant< std::size_t, - NS_SSCRISK_CEL_OR_SPROUT::max(sprout::detail::int_digits(sprout::numeric_limits::max_exponent10), 2) + sprout::tpp::max_element_c::max_exponent10>::value, 2>::value > {}; } // namespace detail diff --git a/sprout/tuple/tuple/tuple_element.hpp b/sprout/tuple/tuple/tuple_element.hpp index 2c69b7ff..56819f48 100644 --- a/sprout/tuple/tuple/tuple_element.hpp +++ b/sprout/tuple/tuple/tuple_element.hpp @@ -23,7 +23,11 @@ namespace sprout { // tuple_element // namespace detail { +#if defined(_MSC_VER) + template +#else template >::value> +#endif struct valid_tuple_index; template struct valid_tuple_index @@ -34,7 +38,11 @@ namespace sprout { : public sprout::bool_constant<(I < std::tuple_size::value)> {}; +#if defined(_MSC_VER) + template +#else template >::value && sprout::tuples::detail::valid_tuple_index::value> +#endif struct tuple_element_default; template struct tuple_element_default diff --git a/sprout/tuple/tuple/tuple_size.hpp b/sprout/tuple/tuple/tuple_size.hpp index ec149e70..87e1177b 100644 --- a/sprout/tuple/tuple/tuple_size.hpp +++ b/sprout/tuple/tuple/tuple_size.hpp @@ -21,7 +21,11 @@ namespace sprout { // tuple_size // namespace detail { +#if defined(_MSC_VER) + template +#else template >::value> +#endif struct tuple_size_default; template struct tuple_size_default diff --git a/sprout/type/string/to_string.hpp b/sprout/type/string/to_string.hpp index dd4953e6..d113aaa7 100644 --- a/sprout/type/string/to_string.hpp +++ b/sprout/type/string/to_string.hpp @@ -23,6 +23,7 @@ namespace sprout { namespace types { +#ifndef SPROUT_CONFIG_DISABLE_CONSTEXPR // // to_string // @@ -85,6 +86,7 @@ namespace sprout { typedef typename sprout::types::to_string::type TYPE # define SPROUT_TYPES_STRING_TYPEDEF(SOURCE, TYPE) \ SPROUT_TYPES_STRING_TYPEDEF_IMPL(SOURCE, TYPE, SPROUT_PP_SOME_NUMBER()) +#endif } // namespace types } // namespace sprout diff --git a/sprout/type/type_tuple_decl.hpp b/sprout/type/type_tuple_decl.hpp index c233ce99..b2ae7f07 100644 --- a/sprout/type/type_tuple_decl.hpp +++ b/sprout/type/type_tuple_decl.hpp @@ -72,13 +72,49 @@ namespace sprout { : public sprout::identity > {}; + // !!! OLD: + //template + //struct tuple_skip; + //template + //struct tuple_skip< + // I, N, sprout::types::type_tuple, + // typename std::enable_if<(I == 0)>::type + //> + // : public sprout::identity > + //{}; + //template + //struct tuple_skip< + // I, N, sprout::types::type_tuple, + // typename std::enable_if<(I != 0 && I < N / 2)>::type + //> + // : public sprout::types::detail::tuple_skip< + // I - 1, N / 2 - 1, + // sprout::types::type_tuple + // > + //{}; + //template + //struct tuple_skip< + // I, N, sprout::types::type_tuple, + // typename std::enable_if<(I != 0 && I >= N / 2)>::type + //> + // : public sprout::types::detail::tuple_skip< + // I - N / 2, N - N / 2, + // typename sprout::types::detail::tuple_skip >::type + // > + //{}; + //template + //struct tuple_drop; + //template + //struct tuple_drop > + // : public sprout::types::detail::tuple_skip> + //{}; template struct tuple_drop_helper; template struct tuple_drop_helper > { template static sprout::types::type_tuple - eval(typename sprout::types::detail::dummy_index::type*..., Types*...); + eval(typename sprout::types::detail::dummy_index::type*..., Types*...); }; template::value)> struct tuple_drop_impl; @@ -90,8 +126,8 @@ namespace sprout { struct tuple_drop_impl, true> : public sprout::identity::type> - ::eval(static_cast*>(0)...) - )>::type + ::eval(typename sprout::identity*>::type()...) + )>::type {}; template struct tuple_drop diff --git a/sprout/type_traits/has_xxx.hpp b/sprout/type_traits/has_xxx.hpp index 281d3f03..a7f7ac5d 100644 --- a/sprout/type_traits/has_xxx.hpp +++ b/sprout/type_traits/has_xxx.hpp @@ -18,7 +18,7 @@ // SPROUT_HAS_XXX_TYPE_DEF // SPROUT_HAS_XXX_TYPE_DEF_LAZY // -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) #define SPROUT_HAS_XXX_TYPE_DEF_IMPL(NAME, TYPE, NUM) \ template \ sprout::true_type SPROUT_PP_CAT(SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_has_xxx_impl_check_type_, TYPE), NAME), NUM)(int); \ @@ -48,7 +48,7 @@ // SPROUT_HAS_XXX_VALUE_DEF // SPROUT_HAS_XXX_VALUE_DEF_LAZY // -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) #define SPROUT_HAS_XXX_VALUE_DEF_IMPL(NAME, VALUE, NUM) \ template::type = &T::VALUE> \ sprout::true_type SPROUT_PP_CAT(SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_has_xxx_impl_check_value_, VALUE), NAME), NUM)(int); \ @@ -78,7 +78,7 @@ // SPROUT_HAS_XXX_TEMPLATE_DEF // SPROUT_HAS_XXX_TEMPLATE_DEF_LAZY // -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) #define SPROUT_HAS_XXX_TEMPLATE_DEF_IMPL(NAME, TEMPLATE, NUM) \ template class = T::template TEMPLATE> \ sprout::true_type SPROUT_PP_CAT(SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_has_xxx_impl_check_type_, TEMPLATE), NAME), NUM)(int); \ diff --git a/sprout/type_traits/inherit_if_xxx.hpp b/sprout/type_traits/inherit_if_xxx.hpp index b81306b4..625e48e3 100644 --- a/sprout/type_traits/inherit_if_xxx.hpp +++ b/sprout/type_traits/inherit_if_xxx.hpp @@ -63,12 +63,12 @@ > { \ public: \ SPROUT_STATIC_CONSTEXPR std::size_t ALIAS = T::CONSTANT; \ - }; \ + };/* \ template \ SPROUT_CONSTEXPR_OR_CONST std::size_t NAME< \ T, \ typename std::enable_if::value>::type \ - >::ALIAS + >::ALIAS !!! */ #else #define SPROUT_INHERIT_ALIAS_IF_XXX_CONSTANT_DEF_IMPL(NAME, ALIAS, CONSTANT, NUM) \ SPROUT_HAS_XXX_VALUE_DEF(SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), NUM), CONSTANT); \ diff --git a/sprout/type_traits/is_destructible.hpp b/sprout/type_traits/is_destructible.hpp index cc38a0c7..a62681aa 100644 --- a/sprout/type_traits/is_destructible.hpp +++ b/sprout/type_traits/is_destructible.hpp @@ -29,7 +29,7 @@ namespace sprout { template static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template(0))>::type> struct is_destructible_impl_0 : public Base_ diff --git a/sprout/type_traits/is_nothrow_destructible.hpp b/sprout/type_traits/is_nothrow_destructible.hpp index 54d175ca..3a97bd93 100644 --- a/sprout/type_traits/is_nothrow_destructible.hpp +++ b/sprout/type_traits/is_nothrow_destructible.hpp @@ -26,7 +26,7 @@ namespace sprout { template static sprout::false_type test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template(0))>::type> struct is_nothrow_destructible_impl_0 : public Base_ diff --git a/sprout/type_traits/result_of.hpp b/sprout/type_traits/result_of.hpp index 1affddf2..3f769151 100644 --- a/sprout/type_traits/result_of.hpp +++ b/sprout/type_traits/result_of.hpp @@ -8,13 +8,23 @@ #ifndef SPROUT_TYPE_TRAITS_RESULT_OF_HPP #define SPROUT_TYPE_TRAITS_RESULT_OF_HPP +#if defined(_MSC_VER) && (_MSC_VER <= 1900) +# include +#endif #include #include #include #include #include +#include namespace sprout { +#if defined(_MSC_VER) && (_MSC_VER <= 1900) + // + // result_of + // + using std::result_of; +#else // // result_of // @@ -26,7 +36,7 @@ namespace sprout { template static sprout::detail::nil_base test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template< typename MemPtr, typename Arg, typename... Args, typename Base_ = sprout::identity(0))>::type @@ -48,7 +58,7 @@ namespace sprout { template static sprout::detail::nil_base test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template< typename MemPtr, typename Arg, typename... Args, typename Base_ = sprout::identity(0))>::type @@ -70,7 +80,7 @@ namespace sprout { template static sprout::detail::nil_base test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template< typename MemPtr, typename Arg, typename Base_ = sprout::identity(0))>::type @@ -92,7 +102,7 @@ namespace sprout { template static sprout::detail::nil_base test(...); }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER > 1900) template< typename MemPtr, typename Arg, typename Base_ = sprout::identity(0))>::type @@ -147,7 +157,7 @@ namespace sprout { public: template static sprout::identity()(std::declval()...))> test(int); - template + template static sprout::detail::nil_base test(...); }; #if defined(_MSC_VER) @@ -194,6 +204,7 @@ namespace sprout { Functor, Args... > {}; +#endif #if SPROUT_USE_TEMPLATE_ALIASES template diff --git a/sprout/utility/forward.hpp b/sprout/utility/forward.hpp index 1c4e50f9..d9b031bf 100644 --- a/sprout/utility/forward.hpp +++ b/sprout/utility/forward.hpp @@ -44,7 +44,7 @@ namespace sprout { // // SPROUT_FORWARD // -#if SPROUT_PP_VARIADICS +#if SPROUT_PP_VARIADICS && !defined(_MSC_VER) # define SPROUT_FORWARD_1(VAR) \ SPROUT_AUTO_FORWARD(VAR) # define SPROUT_FORWARD(...) \ diff --git a/testspr/header_all.hpp b/testspr/header_all.hpp index 66051358..eb5ac42b 100644 --- a/testspr/header_all.hpp +++ b/testspr/header_all.hpp @@ -86,179 +86,179 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include -#include -#include -#include -#include -#include -#include -#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include #endif // #ifndef TESTSPR_HEADER_ALL_HPP