Added is_nan_impl implementations for is_nan, to_int64, string_to_real

Replaced unchecked std::copy with std::copy_n
This commit is contained in:
schoetbi 2018-07-03 10:18:04 +02:00
parent 4d0431c5e4
commit b4e4a1f565
1 changed files with 19 additions and 3 deletions

View File

@ -820,6 +820,11 @@ namespace exprtk
return std::not_equal_to<T>()(v,v);
}
template <typename T>
inline bool is_nan_impl(const T v, int_type_tag) {
return std::not_equal_to<T>()(v, v);
}
template <typename T>
inline int to_int32_impl(const T v, real_type_tag)
{
@ -838,6 +843,11 @@ namespace exprtk
return static_cast<long long int>(v);
}
template <typename T>
inline long long int to_int64_impl(const T v, int_type_tag) {
return static_cast<long long int>(v);
}
template <typename T>
inline bool is_true_impl(const T v)
{
@ -1980,6 +1990,12 @@ namespace exprtk
return true;
}
template <typename Iterator, typename T>
inline bool string_to_real(Iterator& itr_external, const Iterator end, T& t, numeric::details::int_type_tag) {
numeric::details::real_type_tag rtt;
return string_to_real(itr_external, end, t, rtt);
}
template <typename T>
inline bool string_to_real(const std::string& s, T& t)
{
@ -8564,9 +8580,9 @@ namespace exprtk
{
std::size_t size = std::min((s0_r1 - s0_r0),(s1_r1 - s1_r0)) + 1;
std::copy(str1_base_ptr_->base() + s1_r0,
str1_base_ptr_->base() + s1_r0 + size,
const_cast<char_ptr>(base() + s0_r0));
std::copy_n(str1_base_ptr_->base() + s1_r0,
size,
std::back_inserter(str0_node_ptr_->ref()));
}
}