Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Range fancify please
From: anony (janezz55_at_[hidden])
Date: 2009-12-27 01:04:13


OvermindDL1 pravi:
> On Sat, Dec 26, 2009 at 8:33 PM, anony <janezz55_at_[hidden]> wrote:
>> 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;
>> }
>
> Are you sure that is correct, you are only multiplying the first 7
> floats (out of 8*3=24)...

Nope, I am multiplying all the 24 of them (I've checked!).
boost::begin() and boost::end() only return pointers (i.e., vertices[0]
is an array in itself, not a single float).


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