S
Steven T. Hatton
I have a std::vector<Vec3*> _vertices and an object BoundingBox _bbox. _bbox
has a member function called void expandBy(Vec3& v); I want to call
_bbox.expandBy on every member of _vertices. I know I can loop through and
do that. I also know I can create a function object and pass it. The
latter can be pretty slick, if I will be doing it a lot. It seems more
trouble than it's worth to do it for only one function in one class.
AFAIK, there is no way to use things such as mem_fun to do that. They
apply to the objects in the container being iterated over by the STL
algorithm.
Is there a way to accomplish what I want with the STL algorithms? Boost?
--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell
has a member function called void expandBy(Vec3& v); I want to call
_bbox.expandBy on every member of _vertices. I know I can loop through and
do that. I also know I can create a function object and pass it. The
latter can be pretty slick, if I will be doing it a lot. It seems more
trouble than it's worth to do it for only one function in one class.
AFAIK, there is no way to use things such as mem_fun to do that. They
apply to the objects in the container being iterated over by the STL
algorithm.
Is there a way to accomplish what I want with the STL algorithms? Boost?
--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell