"__comp cannot be used as a function" c++ while trying next_permutation
<p>I'm trying to do permutations with next_permutation from the stl, however I'm getting an error and I can't figure out how to fix it. I've tried googling, however the only results that come up are when people used the same function and function's variables name but thats not the case here. </p>

<p>Here's the error : </p>

<pre><code>'__comp' cannot be used as a function
</code></pre>

<p>Here's the code :</p>

<pre><code>struct rectangle{
    int n;
    int h;
    int w;
};

bool check(const rectangle&amp; rect1,const rectangle&amp; rect2){
    return rect1.n &lt; rect2.n;
}

do{
//...
} while ( next_permutation(recs.begin(), recs.end(), check) ); // Getting error on this line.
</code></pre>

<p>Here's the full source code along with the sample input in case it's needed  <a href="http://pastebin.com/eNRNCuTf" rel="nofollow">http://pastebin.com/eNRNCuTf</a></p>
