Fix some warnings

This commit is contained in:
Vinnie Falco
2013-06-24 18:26:24 -07:00
parent 36ecca14d7
commit ffdfb59564
5 changed files with 30 additions and 14 deletions

View File

@@ -260,6 +260,26 @@ public:
}
private:
/** Returns a value or throws if out of range.
This will throw if the source value cannot be represented
within the destination type.
*/
// VFALCO NOTE This won't work right
/*
template <class T, class U>
static T getWithRangeCheck (U v)
{
if (v < std::numeric_limits <T>::min ()) ||
v > std::numeric_limits <T>::max ())
{
throw std::runtime_error ("Value out of range");
}
return static_cast <T> (v);
}
*/
// VFALCO TODO these parameters should not be const references.
template <typename T, typename U>
static T range_check_cast (const U& value, const T& minimum, const T& maximum)