Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/GenericToolbox.Macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#endif // HAS_CPP_11


//#define WARN_DEPRECATED_FCT
#define WARN_DEPRECATED_FCT /* Always flag deprecation */
#ifndef WARN_DEPRECATED_FCT
#define GT_DEPRECATED(msg_) // nothing
#else
Expand Down
5 changes: 3 additions & 2 deletions include/GenericToolbox.Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,12 @@ namespace GenericToolbox{
[[nodiscard]] bool hasBound() const{ return hasLowerBound() or hasUpperBound(); }
[[nodiscard]] bool hasBothBounds() const{ return hasLowerBound() and hasUpperBound(); }
[[nodiscard]] bool isUnbounded() const{ return not hasBound(); }
[[nodiscard]] bool isBellowMin(double val_) const{ return (hasLowerBound() and val_ < min); }
[[nodiscard]] bool isBelowMin(double val_) const{ return (hasLowerBound() and val_ < min); }
[[nodiscard]] GT_DEPRECATED("replace with isBelowMin()") bool isBellowMin(double val_) const { return isBelowMin(val_); }
[[nodiscard]] bool isAboveMax(double val_) const{ return (hasUpperBound() and val_ > max); }
[[nodiscard]] bool isInBounds(double val_) const{
// both bounds are inclusive [min, max]
if( isBellowMin(val_) ){ return false; }
if( isBelowMin(val_) ){ return false; }
if( isAboveMax(val_) ){ return false; }
return true;
}
Expand Down