
"Tobias Schwinger" <tschwinger@neoscientists.org> wrote in message news:d0k5m1$4cp$1@sea.gmane.org...
That's the special case where all elements are used.
I use 'apply', 'apply_one' and 'apply_but' functions that allow me to apply functors to all elements, one element and all but one elements, respectively (I use different versions for both static and dynamic indices and both static and dynamic functors):
// Create an expression inverting the first element // of my_vector (using Boost.Lambda) apply_one<0> (my_vector, - _1)
Further the result type may not always be the same as the argument type:
vector_slice<0,3> (my_quaternion) = direction * std::sin(a*half);
I'm not sure such library needs 'apply', 'apply_one', 'apply_but'. User of my library will add them easily by himself if he really needs it, but in most case I don't think he is. -- Pavel Chikulaev