title: How to use bind with abstract class passed by reference
body: <p>I'm trying to use std::transform with std::bind to simplify a loop. Here's some code:</p>
  
  <pre><code>class ITest
  {
  public:
      virtual CPrueba Prueba(double p, double d = 0)const = 0;
  };
  
  void foo(const ITest&amp; test)
  {
      std::vector&lt;double&gt; v;
      std::vector&lt;CPrueba&gt; vRes;
      // ...
      // ...
      std::transform(v.begin(), v.end(), back_inserter(vRes), 
                     bind(&amp;ITest::Prueba, test, _1, 0));
      //...
  }
  </code></pre>
  
  <p>This doesn't compile. </p>
  
  <p>I'm using VS2008 SP1 and I was getting a lot of template errors I didn't understand, so <a href="http://ideone.com/OdWtXl" rel="nofollow">I've tried in ideone</a> (gcc 4.7.2). There I've got some more readable errors and I've concluded that it had to do with ITest being abstract. </p>
  
  <p>But I've tried by changing how I pass the test object, and if I do it <a href="http://ideone.com/u7NyUU" rel="nofollow">by pointer, it works</a>.</p>
  
  <p>So is there anything I can use to keep the function signature and still use transform with bind, instead of the loop?</p>