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:
parent
4d0431c5e4
commit
b4e4a1f565
22
exprtk.hpp
22
exprtk.hpp
|
@ -820,6 +820,11 @@ namespace exprtk
|
||||||
return std::not_equal_to<T>()(v,v);
|
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>
|
template <typename T>
|
||||||
inline int to_int32_impl(const T v, real_type_tag)
|
inline int to_int32_impl(const T v, real_type_tag)
|
||||||
{
|
{
|
||||||
|
@ -838,6 +843,11 @@ namespace exprtk
|
||||||
return static_cast<long long int>(v);
|
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>
|
template <typename T>
|
||||||
inline bool is_true_impl(const T v)
|
inline bool is_true_impl(const T v)
|
||||||
{
|
{
|
||||||
|
@ -1980,6 +1990,12 @@ namespace exprtk
|
||||||
return true;
|
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>
|
template <typename T>
|
||||||
inline bool string_to_real(const std::string& s, T& 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::size_t size = std::min((s0_r1 - s0_r0),(s1_r1 - s1_r0)) + 1;
|
||||||
|
|
||||||
std::copy(str1_base_ptr_->base() + s1_r0,
|
std::copy_n(str1_base_ptr_->base() + s1_r0,
|
||||||
str1_base_ptr_->base() + s1_r0 + size,
|
size,
|
||||||
const_cast<char_ptr>(base() + s0_r0));
|
std::back_inserter(str0_node_ptr_->ref()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue