fix link error in VC++

This commit is contained in:
bolero-MURAKAMI 2016-03-08 18:22:38 +09:00
parent cb801ffef8
commit 8e24d4551c
7 changed files with 47 additions and 30 deletions

View file

@ -18,33 +18,34 @@
// //
#if SPROUT_USE_UNICODE_LITERALS #if SPROUT_USE_UNICODE_LITERALS
# define SPROUT_LITERAL_STRING_DEF(NAME, STRING, LENGTH) \ # define SPROUT_LITERAL_STRING_DEF(NAME, STRING, LENGTH) \
template<typename Elem> \ template<typename Elem, typename X = void> \
struct NAME; \ struct NAME; \
SPROUT_LITERAL_STRING_DEF_IMPL(NAME, STRING, LENGTH, char); \ SPROUT_LITERAL_STRING_DEF_IMPL(NAME, STRING, LENGTH, char); \
SPROUT_LITERAL_STRING_DEF_IMPL(NAME, SPROUT_PP_CAT(L, STRING), LENGTH, wchar_t); \ SPROUT_LITERAL_STRING_DEF_IMPL(NAME, SPROUT_PP_CAT(L, STRING), LENGTH, wchar_t); \
SPROUT_LITERAL_STRING_DEF_IMPL(NAME, SPROUT_PP_CAT(u, STRING), LENGTH, char16_t); \ SPROUT_LITERAL_STRING_DEF_IMPL(NAME, SPROUT_PP_CAT(u, STRING), LENGTH, char16_t); \
SPROUT_LITERAL_STRING_DEF_IMPL(NAME, SPROUT_PP_CAT(U, STRING), LENGTH, char32_t); \ SPROUT_LITERAL_STRING_DEF_IMPL(NAME, SPROUT_PP_CAT(U, STRING), LENGTH, char32_t); \
template<typename Elem> \ template<typename Elem, typename X> \
struct NAME {} struct NAME {}
#else #else
# define SPROUT_LITERAL_STRING_DEF(NAME, STRING, LENGTH) \ # define SPROUT_LITERAL_STRING_DEF(NAME, STRING, LENGTH) \
template<typename Elem> \ template<typename Elem, typename X = void> \
struct NAME; \ struct NAME; \
SPROUT_LITERAL_STRING_DEF_IMPL(NAME, STRING, LENGTH, char); \ SPROUT_LITERAL_STRING_DEF_IMPL(NAME, STRING, LENGTH, char); \
SPROUT_LITERAL_STRING_DEF_IMPL(NAME, SPROUT_PP_CAT(L, STRING), LENGTH, wchar_t); \ SPROUT_LITERAL_STRING_DEF_IMPL(NAME, SPROUT_PP_CAT(L, STRING), LENGTH, wchar_t); \
template<typename Elem> \ template<typename Elem, typename X> \
struct NAME {} struct NAME {}
#endif #endif
#define SPROUT_LITERAL_STRING_DEF_IMPL(NAME, STRING, LENGTH, ELEM) \ #define SPROUT_LITERAL_STRING_DEF_IMPL(NAME, STRING, LENGTH, ELEM) \
template<> \ template<typename X> \
struct NAME<ELEM> { \ struct NAME<ELEM, X> { \
public: \ public: \
SPROUT_STATIC_CONSTEXPR sprout::basic_string<ELEM, LENGTH> value \ SPROUT_STATIC_CONSTEXPR sprout::basic_string<ELEM, LENGTH> value \
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(STRING) \ SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(STRING)) \
; \ ; \
}; \ }; \
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<ELEM, LENGTH> NAME<ELEM>::value \ template<typename X> \
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(STRING) SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<ELEM, LENGTH> NAME<ELEM, X>::value \
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(STRING))
// //
// SPROUT_LITERAL_CHAR_DEF // SPROUT_LITERAL_CHAR_DEF

View file

@ -179,6 +179,10 @@ namespace sprout {
; ;
}; };
template<typename X> template<typename X>
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::math::detail::bernoulli_numbers<
float, X
>::limit;
template<typename X>
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers< SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers<
float, X float, X
>::table_type sprout::math::detail::bernoulli_numbers< >::table_type sprout::math::detail::bernoulli_numbers<
@ -199,6 +203,10 @@ namespace sprout {
; ;
}; };
template<typename X> template<typename X>
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::math::detail::bernoulli_numbers<
double, X
>::limit;
template<typename X>
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers< SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers<
double, X double, X
>::table_type sprout::math::detail::bernoulli_numbers< >::table_type sprout::math::detail::bernoulli_numbers<
@ -219,6 +227,10 @@ namespace sprout {
; ;
}; };
template<typename X> template<typename X>
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::math::detail::bernoulli_numbers<
long double, X
>::limit;
template<typename X>
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers< SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers<
long double, X long double, X
>::table_type sprout::math::detail::bernoulli_numbers< >::table_type sprout::math::detail::bernoulli_numbers<

View file

@ -301,7 +301,7 @@ namespace sprout {
} }
template<sprout::index_t... Indexes> template<sprout::index_t... Indexes>
SPROUT_CONSTEXPR std::tuple<Types...> SPROUT_CONSTEXPR std::tuple<Types...>
to_std_tuple(sprout::index_tuple<Indexes...>) { to_std_tuple(sprout::index_tuple<Indexes...>) const {
return std::tuple<Types...>(base_type::template get<Indexes>(*this)...); return std::tuple<Types...>(base_type::template get<Indexes>(*this)...);
} }
public: public:

View file

@ -22,14 +22,14 @@ namespace sprout {
namespace detail { namespace detail {
SPROUT_LITERAL_STRING_DEF(bdigits, "01", 2); SPROUT_LITERAL_STRING_DEF(bdigits, "01", 2);
template<typename Dummy> template<typename Dummy, typename X = void>
struct bvalues; struct bvalues;
# define SPROUT_WEED_BDIGITS_TABLE_DEF \ # define SPROUT_WEED_BDIGITS_TABLE_DEF \
{{0, 1}} {{0, 1}}
template<> template<typename X>
struct bvalues<void> { struct bvalues<void, X> {
public: public:
typedef sprout::array<std::uint8_t, 2> value_type; typedef sprout::array<std::uint8_t, 2> value_type;
public: public:
@ -37,8 +37,9 @@ namespace sprout {
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_BDIGITS_TABLE_DEF) SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_BDIGITS_TABLE_DEF)
; ;
}; };
SPROUT_CONSTEXPR_OR_CONST sprout::weed::detail::bvalues<void>::value_type template<typename X>
sprout::weed::detail::bvalues<void>::value SPROUT_CONSTEXPR_OR_CONST typename sprout::weed::detail::bvalues<void, X>::value_type
sprout::weed::detail::bvalues<void, X>::value
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_BDIGITS_TABLE_DEF) SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_BDIGITS_TABLE_DEF)
; ;

View file

@ -22,14 +22,14 @@ namespace sprout {
namespace detail { namespace detail {
SPROUT_LITERAL_STRING_DEF(digits, "0123456789", 10); SPROUT_LITERAL_STRING_DEF(digits, "0123456789", 10);
template<typename Dummy> template<typename Dummy, typename X = void>
struct values; struct values;
# define SPROUT_WEED_DIGITS_TABLE_DEF \ # define SPROUT_WEED_DIGITS_TABLE_DEF \
{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}} {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}}
template<> template<typename X>
struct values<void> { struct values<void, X> {
public: public:
typedef sprout::array<std::uint8_t, 10> value_type; typedef sprout::array<std::uint8_t, 10> value_type;
public: public:
@ -37,8 +37,9 @@ namespace sprout {
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_DIGITS_TABLE_DEF) SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_DIGITS_TABLE_DEF)
; ;
}; };
SPROUT_CONSTEXPR_OR_CONST sprout::weed::detail::values<void>::value_type template<typename X>
sprout::weed::detail::values<void>::value SPROUT_CONSTEXPR_OR_CONST typename sprout::weed::detail::values<void, X>::value_type
sprout::weed::detail::values<void, X>::value
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_DIGITS_TABLE_DEF) SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_DIGITS_TABLE_DEF)
; ;

View file

@ -22,14 +22,14 @@ namespace sprout {
namespace detail { namespace detail {
SPROUT_LITERAL_STRING_DEF(odigits, "01234567", 8); SPROUT_LITERAL_STRING_DEF(odigits, "01234567", 8);
template<typename Dummy> template<typename Dummy, typename X = void>
struct ovalues; struct ovalues;
# define SPROUT_WEED_ODIGITS_TABLE_DEF \ # define SPROUT_WEED_ODIGITS_TABLE_DEF \
{{0, 1, 2, 3, 4, 5, 6, 7}} {{0, 1, 2, 3, 4, 5, 6, 7}}
template<> template<typename X>
struct ovalues<void> { struct ovalues<void, X> {
public: public:
typedef sprout::array<std::uint8_t, 8> value_type; typedef sprout::array<std::uint8_t, 8> value_type;
public: public:
@ -37,8 +37,9 @@ namespace sprout {
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_ODIGITS_TABLE_DEF) SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_ODIGITS_TABLE_DEF)
; ;
}; };
SPROUT_CONSTEXPR_OR_CONST sprout::weed::detail::ovalues<void>::value_type template<typename X>
sprout::weed::detail::ovalues<void>::value SPROUT_CONSTEXPR_OR_CONST typename sprout::weed::detail::ovalues<void, X>::value_type
sprout::weed::detail::ovalues<void, X>::value
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_ODIGITS_TABLE_DEF) SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_ODIGITS_TABLE_DEF)
; ;

View file

@ -22,14 +22,14 @@ namespace sprout {
namespace detail { namespace detail {
SPROUT_LITERAL_STRING_DEF(xdigits, "0123456789abcdefABCDEF", 22); SPROUT_LITERAL_STRING_DEF(xdigits, "0123456789abcdefABCDEF", 22);
template<typename Dummy> template<typename Dummy, typename X = void>
struct xvalues; struct xvalues;
# define SPROUT_WEED_XDIGITS_TABLE_DEF \ # define SPROUT_WEED_XDIGITS_TABLE_DEF \
{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14, 15}} {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14, 15}}
template<> template<typename X>
struct xvalues<void> { struct xvalues<void, X> {
public: public:
typedef sprout::array<std::uint8_t, 22> value_type; typedef sprout::array<std::uint8_t, 22> value_type;
public: public:
@ -37,8 +37,9 @@ namespace sprout {
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_XDIGITS_TABLE_DEF) SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_XDIGITS_TABLE_DEF)
; ;
}; };
SPROUT_CONSTEXPR_OR_CONST sprout::weed::detail::xvalues<void>::value_type template<typename X>
sprout::weed::detail::xvalues<void>::value SPROUT_CONSTEXPR_OR_CONST typename sprout::weed::detail::xvalues<void, X>::value_type
sprout::weed::detail::xvalues<void, X>::value
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_XDIGITS_TABLE_DEF) SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_XDIGITS_TABLE_DEF)
; ;