Merge pull request #3185 from lioncash/vec-index

vector_math: Return by const reference for const operator[]
This commit is contained in:
bunnei 2017-12-04 16:05:03 -05:00 committed by GitHub
commit 79e246d82f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -131,7 +131,7 @@ public:
{ {
return *((&x) + i); return *((&x) + i);
} }
T operator[](const int i) const { const T& operator[](const int i) const {
return *((&x) + i); return *((&x) + i);
} }
@ -288,7 +288,7 @@ public:
{ {
return *((&x) + i); return *((&x) + i);
} }
T operator[](const int i) const { const T& operator[](const int i) const {
return *((&x) + i); return *((&x) + i);
} }
@ -502,7 +502,7 @@ public:
{ {
return *((&x) + i); return *((&x) + i);
} }
T operator[](const int i) const { const T& operator[](const int i) const {
return *((&x) + i); return *((&x) + i);
} }