|
double operator[](int i) const { return e[i]; } Do these two sentences have the same effect? |
Answered by
hollasch
Mar 29, 2024
Replies: 1 comment 2 replies
The
This one returns a reference (pointer) to the actual double-precision floating-point value inside the |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm afraid this is some C++ low-level detail that's unfortunately necessary here. We really try to keep C++ specifics to a minimum. This could look quite different in your own code, depending on your language of choice.
To be a bit more concrete, the first form lets you grab elements out of any
vec3object, likeThe second form lets you change/set vector values, like so: