Hi there, <br><br>I am testing the following sample code on page 264 of  the book &quot;Beyond the C++ Standard Library&quot; and got an error msg: &quot;result_type&#39; : is not a member of &#39;`global namespace&#39;&#39; from MSVC 2008 Pro compiler. Can anyone point out what is wrong with it? Thanks.<br>
------------<br>#include&lt;iostream&gt;<br>#include&lt;string&gt;                                        <br>#include&lt;map&gt;<br>#include&lt;vector&gt;<br>#include&lt;algorithm&gt;<br>#include &quot;boost/bind.hpp&quot;<br>
<br>class print_size {                                                    <br>    typedef std::map&lt;std::string, std::vector&lt;int&gt; &gt; map_type;<br>public:<br>    typedef void result_type;                                        <br>
    result_type operator()(std::ostream&amp; os, const map_type::value_type&amp; x) const {            <br>        os &lt;&lt; x.second.size() &lt;&lt; &#39;\n&#39;;<br>    }<br>};<br><br>int main() {<br>    typedef std::map&lt;std::string, std::vector&lt;int&gt; &gt; map_type;        <br>
    map_type m;<br>    m[&quot;Strange?&quot;].push_back(1);                                    <br>    m[&quot;Strange?&quot;].push_back(2);<br>    m[&quot;Wierd?&quot;].push_back(3);<br>    m[&quot;Wierd?&quot;].push_back(4);<br>
    m[&quot;Wierd?&quot;].push_back(5);<br><br>    std::for_each(m.begin(), m.end(),<br>        boost::bind(&amp;print_size(), boost::ref(std::cout), _1));        <br>}<br>------------<br>

