Pointer-to-data-member-of-data-member
<p>I had the following piece of code (simplified for this question):</p>

<pre><code>struct StyleInfo
{
    int width;
    int height;
};

typedef int (StyleInfo::*StyleInfoMember);

void AddStyleInfoMembers(std::vector&lt;StyleInfoMember&gt;&amp; members)
{
    members.push_back(&amp;StyleInfo::width);
    members.push_back(&amp;StyleInfo::height);
}
</code></pre>

<p>Now, we had to restructure this a bit, and we did something like this:</p>

<pre><code>struct Rectangle
{
    int width;
    int height;
};

struct StyleInfo
{
    Rectangle size;
};

typedef int (StyleInfo::*StyleInfoMember);

void AddStyleInfoMembers(std::vector&lt;StyleInfoMember&gt;&amp; members)
{
    members.push_back(&amp;StyleInfo::size::width);
    members.push_back(&amp;StyleInfo::size::height);
}
</code></pre>

<p>If this all looks like a stupid thing to do, or if you feel there's a good opportunity to apply BOOST here for some reason, I must warn you that I really simplified it all down to the problem at hand:</p>

<blockquote>
  <p>error C3083: 'size': the symbol to the left of a '::' must be a type</p>
</blockquote>

<p>The point I'm trying to make is that I don't know what the correct syntax is to use here. It might be that "StyleInfo" is not the correct type of take the address from to begin with, but in my project I can fix that sort of thing (there's a whole framework there). I simply don't know how to point to this member-within-a-member.</p>
