how to define range of numbers inside a if condition in c++
template <int min, int max> class range {
static bool contains(int i) { return min <= i && i < max; } // In C++, ranges usually are half-open.
};
int age = 23;
if (range<18,30>::contains(age)) {
//Your desired code
}