Y
yurec
Hi all,
I've following loop and i'm interested if there is any algorithm in
stl (i see just for_each with appropriate logical meaning) maybe with
some boost classes which can replace following loop :
vector<UIStlLink*>::iterator iter_stl =
i_bone_fragments.begin();
vector<MCoordinateSystem>::const_iterator iter_cs =
i_bone_fragments_to.begin();
while (iter_stl != i_bone_fragments.end())
{
UIStlLink * p_stl = *iter_stl;
const MCoordinateSystem & cs = *iter_cs;
TransformObjectTo(p_stl,cs);
++iter_stl;
++iter_cs;
}
ASSERT(iter_cs == i_bone_fragments_to.end());
As for me I would like to see smth like :
vector<MCoordinateSystem>::const_iterator iter_cs =
i_bone_fragments_to.begin();
for_each(i_bone_fragments.begin(),i_bone_fragments.end(),bind(TransformObjectTo,
_1, *iter_cs++));
, but (*iter_cs++) is computed once as expected.
Thanks
I've following loop and i'm interested if there is any algorithm in
stl (i see just for_each with appropriate logical meaning) maybe with
some boost classes which can replace following loop :
vector<UIStlLink*>::iterator iter_stl =
i_bone_fragments.begin();
vector<MCoordinateSystem>::const_iterator iter_cs =
i_bone_fragments_to.begin();
while (iter_stl != i_bone_fragments.end())
{
UIStlLink * p_stl = *iter_stl;
const MCoordinateSystem & cs = *iter_cs;
TransformObjectTo(p_stl,cs);
++iter_stl;
++iter_cs;
}
ASSERT(iter_cs == i_bone_fragments_to.end());
As for me I would like to see smth like :
vector<MCoordinateSystem>::const_iterator iter_cs =
i_bone_fragments_to.begin();
for_each(i_bone_fragments.begin(),i_bone_fragments.end(),bind(TransformObjectTo,
_1, *iter_cs++));
, but (*iter_cs++) is computed once as expected.
Thanks