Hi,<br><br>I have a complex case I&#39;m trying to work with. I may be doing this completely wrong so if there is a better design for this I&#39;m always open for that. However for now I&#39;m going to assume my particular problem can be solved.<br>
<br>There exists two classes: A and B. Class A is defined as such:<br><br><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">class A</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">{</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">public:</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp; template&lt; typename Archive &gt;</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp; void load( Archive&amp; archive, unsigned int )</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp; {</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; archive &amp; m_listOfB;</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp; }</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);"><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">private:</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp; std::vector&lt;int&gt; m_listOfInt;</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp; boost::ptr_vector&lt;B&gt; m_listOfB;</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">};</span><br>
<br>And class B is defined roughly as:<br><br><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">class B</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">{</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">public:</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp; template&lt; typename Archive &gt;</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp; void load( Archive&amp; archive, unsigned int )</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp; {</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Code isn&#39;t important here</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">&nbsp;&nbsp;&nbsp; }</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">};</span><br><br>Here&#39;s the problem:<br><br>For each B that is deserialized by A::load(), I need to pass in a reference to m_listOfInt. So, essentially the load() function in B would look something like this:<br>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">void load( Archive&amp; archive, unsigned int, std::vector&lt;int&gt;&amp; listOfInt )</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">{</span><br style="font-family: courier new,monospace; color: rgb(153, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(153, 0, 0);">}</span><br>
<br>I was hoping boost.bind could be used somewhere, but I just don&#39;t see how. One way to solve the problem is to call B::load() explicitly with the extra parameter, but I don&#39;t think that&#39;s an appropriate solution. Any ideas on how to solve this? Or perhaps I&#39;m trying to solve the wrong problem.<br>