From 9506960a925367b3ac45f8bd7775b3a70cb0baec Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 14 Feb 2021 12:59:07 +0000 Subject: Add operator[] to Arc --- utility/maths.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'utility/maths.h') diff --git a/utility/maths.h b/utility/maths.h index 22688cb..31f5960 100644 --- a/utility/maths.h +++ b/utility/maths.h @@ -5,7 +5,15 @@ #include #include -using Arc = std::pair; +struct Arc : public std::pair { + using std::pair::pair; + + float + operator[](unsigned int i) const + { + return i ? second : first; + } +}; constexpr const glm::vec3 up {0, 1, 0}; constexpr const glm::vec3 north {0, 0, 1}; -- cgit v1.2.3