mirror of
https://github.com/espressif/openthread.git
synced 2026-09-14 13:10:08 +00:00
[num-utils] change IsValueInRange() return type to bool (#11821)
This change corrects the return type of the `IsValueInRange()` template function to `bool`
This commit is contained in:
@@ -159,7 +159,7 @@ template <typename IntType> int8_t ClampToInt8(IntType aValue)
|
|||||||
* @retval TRUE If @p aValue is within `[aMin, aMax]` (inclusive).
|
* @retval TRUE If @p aValue is within `[aMin, aMax]` (inclusive).
|
||||||
* @retval FALSE If @p aValue is not within `[aMin, aMax]` (inclusive).
|
* @retval FALSE If @p aValue is not within `[aMin, aMax]` (inclusive).
|
||||||
*/
|
*/
|
||||||
template <typename Type> Type IsValueInRange(Type aValue, Type aMin, Type aMax)
|
template <typename Type> inline constexpr bool IsValueInRange(Type aValue, Type aMin, Type aMax)
|
||||||
{
|
{
|
||||||
return (aMin <= aValue) && (aValue <= aMax);
|
return (aMin <= aValue) && (aValue <= aMax);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user