Skip to content

Range support - #240

Merged
Groovounet merged 2 commits into
g-truc:masterfrom
Jaxan:range
Oct 5, 2014
Merged

Range support#240
Groovounet merged 2 commits into
g-truc:masterfrom
Jaxan:range

Conversation

@Jaxan

@Jaxan Jaxan commented Sep 19, 2014

Copy link
Copy Markdown

This header enables using vectors and matrices in range based for loops:

glm::vec3 v(1,2,3);
for(auto x : v)
    cout << x << endl;

It also works on matrices, element-wise. If you want to be very fancy, one could add column-iterators and row-iterators, but I didn't need that, so I skipped it. What are your thoughts on this kind of functionality?

Any thoughts about the implementation?

@Groovounet Groovounet added this to the GLM 0.9.6 milestone Sep 19, 2014
@Groovounet Groovounet self-assigned this Sep 19, 2014
@Groovounet

Copy link
Copy Markdown
Member

It looks great. I will add it for GLM 0.9.6.

Thanks for contributing!
Christophe

Groovounet added a commit that referenced this pull request Oct 5, 2014
@Groovounet
Groovounet merged commit 7ab7d4b into g-truc:master Oct 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants