Template Function check_bounds

Template Function check_bounds#

Function Documentation#

template<typename T>
bool check_bounds(const std::string &par_name, T value, T lower_bound, bool inclusive_lower = true, T upper_bound = std::numeric_limits<T>::max(), bool inclusive_upper = true)

Checks if a value falls within bounds.

Template Parameters:

T – type of the checked parameter

Parameters:
  • par_name[in] name of the parameter value

  • value[in] parameter value

  • lower_bound[in] value of the lower bound

  • inclusive_lower[in] whether the lower bound value is included in the bounds

  • upper_bound[in] value of the upper bound

  • inclusive_upper[in] whether the upper bound value is included in the bounds

Returns:

Whether the value falls within bounds or not.