title: Trying to use boost lambda, but my code won't compile
body: <p>I am trying to use boost lambda to avoid having to write trivial functors.
  For example, I want to use the lambda to access a member of a struct or call a method of a class, eg:</p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;utility&gt;
  #include &lt;algorithm&gt;
  #include &lt;boost/lambda/lambda.hpp&gt;
  
  using namespace std;
  using namespace boost::lambda;
  
  vector&lt; pair&lt;int,int&gt; &gt; vp;
  
  vp.push_back( make_pair&lt;int,int&gt;(1,1) );
  vp.push_back( make_pair&lt;int,int&gt;(3,2) );
  vp.push_back( make_pair&lt;int,int&gt;(2,3) );
  
  sort(vp.begin(), vp.end(), _1.first &gt; _2.first );
  </code></pre>
  
  <p>When I try and compile this I get the following errors:</p>
  
  <pre><code>error C2039: 'first' : is not a member of 'boost::lambda::lambda_functor&lt;T&gt;'
          with
          [
              T=boost::lambda::placeholder&lt;1&gt;
          ]
  error C2039: 'first' : is not a member of 'boost::lambda::lambda_functor&lt;T&gt;'
          with
          [
              T=boost::lambda::placeholder&lt;2&gt;
          ]
  </code></pre>
  
  <p>Since vp contains <code>pair&lt;int,int&gt;</code> I thought that _1.first should work.  What I am doing wrong?</p>