|
Boost Users : |
Subject: [Boost-users] Boost.Range fancify please
From: anony (janezz55_at_[hidden])
Date: 2009-12-26 22:33:35
I have this variable definition:
float vertices[][3] = {
{-1, -1, 1}, {1, -1, 1}, {1, 1, 1}, {-1, 1, 1},
{-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1}
};
I want to scale all elements of vertices, by some constant, for now I do
it like this:
BOOST_FOREACH(float& f, boost::make_iterator_range(
boost::begin(vertices[0]), boost::end(vertices[7])))
{
f *= scale;
}
But maybe something more beautiful could be done with Boost.Range?
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net