From 6900553f57b88856adef599864e5e98607d616d2 Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 13 Jun 2020 18:22:05 -0700 Subject: [PATCH] Add INBOUNDS macro I mean, I probably should've done this earlier, but using this saves on typing and improves readability. --- desktop_version/src/UtilityClass.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop_version/src/UtilityClass.h b/desktop_version/src/UtilityClass.h index ea475cc1..9842f17b 100644 --- a/desktop_version/src/UtilityClass.h +++ b/desktop_version/src/UtilityClass.h @@ -13,6 +13,8 @@ std::vector split(const std::string &s, char delim); bool is_positive_num(const std::string& str); +#define INBOUNDS(index, vector) ((int) index >= 0 && (int) index < (int) vector.size()) + //helperClass class UtilityClass