1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00

fix warning: for clang

This commit is contained in:
bolero-MURAKAMI 2013-08-09 20:04:27 +09:00
parent baf8995e81
commit c22735b212
2 changed files with 12 additions and 2 deletions

View file

@ -11,6 +11,8 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#include <sprout/type_traits/is_int.hpp>
#include <sprout/type_traits/is_uint.hpp>
namespace sprout { namespace sprout {
namespace detail { namespace detail {
@ -54,7 +56,7 @@ namespace sprout {
// //
template< template<
int Base = 10, typename IntType, int Base = 10, typename IntType,
typename sprout::enabler_if<std::is_integral<IntType>::value>::type = sprout::enabler typename sprout::enabler_if<sprout::is_int<IntType>::value>::type = sprout::enabler
> >
inline SPROUT_CONSTEXPR int inline SPROUT_CONSTEXPR int
int_digit_at(IntType val, int digits) { int_digit_at(IntType val, int digits) {
@ -62,6 +64,14 @@ namespace sprout {
: (val / sprout::detail::int_pow<IntType, Base>(digits)) % Base : (val / sprout::detail::int_pow<IntType, Base>(digits)) % Base
; ;
} }
template<
int Base = 10, typename IntType,
typename sprout::enabler_if<sprout::is_uint<IntType>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR int
int_digit_at(IntType val, int digits) {
return (val / sprout::detail::int_pow<IntType, Base>(digits)) % Base;
}
} // namespace detail } // namespace detail
} // namespace sprout } // namespace sprout

View file

@ -79,7 +79,7 @@ namespace sprout {
typedef sprout::detail::string_construct_access<T, (M - 1) + N, Traits> access_type; typedef sprout::detail::string_construct_access<T, (M - 1) + N, Traits> access_type;
return access_type::raw_construct( return access_type::raw_construct(
lsize + rsize, lsize + rsize,
(Indexes < lsize ? lhs[Indexes] (Indexes < lsize ? *(lhs + Indexes)
: Indexes < lsize + rsize ? rhs[Indexes - lsize] : Indexes < lsize + rsize ? rhs[Indexes - lsize]
: T() : T()
)... )...