Skip to content
Snippets Groups Projects
Commit 74dc231d authored by Joseph C Wang's avatar Joseph C Wang
Browse files

fix not in range compile error

Clupatra/clupatra_new.cpp calls not in range with negative number and
current unsigned template causes compile error.
parent 039c6702
No related branches found
No related tags found
No related merge requests found
......@@ -15,11 +15,11 @@
namespace nnclu {
/** fast check if integer is in a given range [Min,Max] */
template <unsigned Min,unsigned Max >
template <int Min, int Max >
inline bool inRange( int i){ return ( (unsigned int) ( i - Min ) <= (unsigned int) ( Max - Min ) ); }
/** fast check if integer is not in a given range [Min,Max] */
template <unsigned Min,unsigned Max >
template <int Min, int Max >
inline bool notInRange( int i){ return ( (unsigned int) ( i - Min ) > (unsigned int) ( Max - Min ) ); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment