Commit 0b10cfd5 authored by kosak's avatar kosak
Browse files

Prevent MSVC from issuing warnings about possible value truncations.

parent f253efc2
...@@ -230,7 +230,7 @@ class RangeGenerator : public ParamGeneratorInterface<T> { ...@@ -230,7 +230,7 @@ class RangeGenerator : public ParamGeneratorInterface<T> {
return base_; return base_;
} }
virtual void Advance() { virtual void Advance() {
value_ = value_ + step_; value_ = static_cast<T>(value_ + step_);
index_++; index_++;
} }
virtual ParamIteratorInterface<T>* Clone() const { virtual ParamIteratorInterface<T>* Clone() const {
...@@ -267,7 +267,7 @@ class RangeGenerator : public ParamGeneratorInterface<T> { ...@@ -267,7 +267,7 @@ class RangeGenerator : public ParamGeneratorInterface<T> {
const T& end, const T& end,
const IncrementT& step) { const IncrementT& step) {
int end_index = 0; int end_index = 0;
for (T i = begin; i < end; i = i + step) for (T i = begin; i < end; i = static_cast<T>(i + step))
end_index++; end_index++;
return end_index; return end_index;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment