Is there a way of applying a function to each member of a struct in c++?
<p>You have a simple struct, say:</p>

<pre><code>typedef struct rect
{
    int x;
    int y;
    int width;
    int height;
}
rect;
</code></pre>

<p>And you want to multiply each element by a factor.  Is there a more concise way of performing this operation, other than multiplying each member by the value?</p>
