C++11 conditional expression on std::greater and std::less got error of different types
<p>The following codes related to conditional expression:</p>

<pre><code>typedef unsigned char uchar;
uchar data[100];
// assign something to array[] here
uchar *start = data;
uchar *end = data+100;
bool cond = f();  // f() could return true or false
uchar *itr = std::upper_bound(start, end, uchar(20), 
                cond? std::greater&lt;uchar&gt;() : std::less&lt;uchar&gt;());
</code></pre>

<p>got an error like this:</p>

<pre><code>error: operands to ?: have different types 
‘std::greater&lt;unsigned char&gt;’ and ‘std::less&lt;unsigned char&gt;’
</code></pre>

<p>Is this a compiler bug? In my instinct, the two functor should have the same type.</p>