Last active
January 16, 2017 19:31
-
-
Save vlj/f3ad798d7ac2fe3a86208a13759b664e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <range/v3/all.hpp> | |
struct model{ | |
uint16_t indices[3]; | |
}; | |
int main() | |
{ | |
uint16_t ptr[256]; | |
model models[256 / 3]; | |
const auto& output = ranges::make_range(ptr, ptr + 256) | ranges::view::chunk(3); | |
const auto& input = ranges::make_range(models, models + 256 / 3) | | |
ranges::view::transform([](const auto& m) { return ranges::make_range(m.indices, m.indices + 3); }) | | |
ranges::view::join; | |
ranges::copy(input, output); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment