Initializing and assigning values,from pass by reference
<p>Okay, this is just a minor caveat. I am currently working with the lovely ArcSDK from ESRI. Now to get a value from any of their functions, you basically have to pass the variable, you want to assign the value to.</p>

<p>E.g.:</p>

<pre><code>long output_width;
IRasterProps-&gt;get_Width(&amp;output_width);
</code></pre>

<p>Its such a minor thing, but when you have to pick out around 30 different pieces of data from their miscellaneous functions, it really starts to get annoying.</p>

<p>So what i was wondering is it possible to somehow by the magic of STL or C++ change this into:</p>

<pre><code>long output_width = IRasterProps-&gt;get_Width(&lt;something magical&gt;);
</code></pre>

<p>All of the functions return void, otherwise the off chance some of them might return a HRESULT, which i can safely ignore. Any ideas?</p>

<p><strong>*EDIT**</strong></p>

<p>Heres the final result i got which works :)!!!!!</p>

<pre><code>A magic(P p, R (__stdcall T::*f)(A *)) {
    A a;
    ((*p).*f)(&amp;a);
    return a;
}
</code></pre>
