add within
This commit is contained in:
15
src/range/range.hpp
Normal file
15
src/range/range.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace hack
|
||||
{
|
||||
template<typename T, typename... Args>
|
||||
bool within(T min, T max, Args... args)
|
||||
{
|
||||
return ((min <= args && max >= args) && ...);
|
||||
// 1, 5, 2, 3, 4
|
||||
// ( (1 <= 2 && 5 >= 2) && (1 <= 3 && 5 >= 3) && (1 <= 4 && 5 >= 4) )
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user