Boost C++ Libraries: Ticket #4359: boost bind doesn't work with inherited structures https://svn.boost.org/trac10/ticket/4359 <p> The following code gives an error in VC++2008, VC++2010, g++ 4.2.4: </p> <pre class="wiki">#include &lt;boost/bind.hpp&gt; struct Y { void reset() {}; }; template&lt;typename T1, typename T2&gt; struct my_pair { T1 first; T2 second; }; template&lt;typename T1, typename T2&gt; struct my_pair2 : my_pair&lt;T1, T2&gt; {}; typedef my_pair&lt;int, Y&gt; mypair_t; typedef my_pair2&lt;int, Y&gt; mypair2_t; int main() { mypair_t t1; mypair2_t t2; boost::bind&lt;Y&amp;&gt;( &amp;mypair_t::second, _1 )( t1 ).reset(); // OK! boost::bind&lt;Y&amp;&gt;( &amp;mypair2_t::second, _1 )( t2 ).reset(); // error: cannot convert from 'const Y' to 'Y &amp;' return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4359 Trac 1.4.3 Steven Watanabe Thu, 24 Jun 2010 20:26:21 GMT <link>https://svn.boost.org/trac10/ticket/4359#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4359#comment:1</guid> <description> <p> This is a result of mem_fn's logic for handling get_pointer. I'm somewhat hesitant to touch this, as it's rather easy to break older compilers. </p> </description> <category>Ticket</category> </item> </channel> </rss>