title: Using Boost.Phoenix's operator ->*
body: <p>I'm playing around with Phoenix v3 trying to figure out whether we should standardize on it instead of the current mix of Bind and Lambda. From the documentation I got the impression that it should be possible to simplify some expressions.</p>
  
  <p>Currently I'm stuck on the usage of the ->* operator in combination with the STL algos. The following will compile (Visual Studio 2008 SP1) but not give the expected output:</p>
  
  <pre><code>#include &lt;algorithm&gt;
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;boost/mem_fn.hpp&gt;
  #include &lt;boost/phoenix.hpp&gt;
  using namespace std;
  using namespace boost;
  using namespace boost::phoenix;
  using namespace boost::phoenix::arg_names;
  
  struct A
  {
    void f() const { cout &lt;&lt; "A"; };
  };
  struct B
  {
    A a() { return A(); };
  };
  
  int main()
  {
    vector&lt;A&gt; va(1);
    for_each(va.begin(), va.end(), bind(mem_fn(&amp;A::f), arg1));
    for_each(va.begin(), va.end(), arg1-&gt;*&amp;A::f);
  
    vector&lt;B&gt; vb(1);
    for_each(vb.begin(), vb.end(), bind(mem_fn(&amp;A::f), bind(mem_fn(&amp;B::a), arg1)));
    return 0;
  }
  </code></pre>
  
  <p>Running this example will print out 'A' twice, both times for the bind-based loops.
  So here are my questions:</p>
  
  <ul>
  <li>What should I change in order to have the operator-based loop actually call A::f?</li>
  <li>How could I change the double-bind loop using operators?</li>
  <li>Anyone know why VS2008 is always complaining when you don't specify mem_fn in these cases? I always get warning C4180 (qualifier applied to function type has no meaning; ignored).</li>
  </ul>
  
  <p>Thanks in advance for any insights.</p>