What is the type of `a ? b : c`?
<p>Let's say we have</p>

<pre><code>template &lt;typename T&gt;
struct Foo
{};
</code></pre>

<p>and</p>

<pre><code>struct Bar
{
    template &lt;typename T&gt;
    operator Foo&lt;T&gt;() const { return Foo&lt;T&gt;(); }
};
</code></pre>

<p>and</p>

<pre><code>template &lt;typename T&gt;
Foo&lt;T&gt; Baz(T const&amp;) { return Foo&lt;T&gt;(); }
</code></pre>

<p>Then, <code>true ? Bar() : Baz(some_expr_of_type_double)</code> has type <code>Foo&lt;double&gt;</code> because <code>Bar</code> is convertible to <code>Foo&lt;double&gt;</code>. This trick is used to query the type of <code>some_expr_of_type_double</code> without evaluating it.</p>

<p>What are the rules for determining the type of <code>a ? b : c</code> ? I'd appreciate the relevant part of the standard (I don't have a copy). Is there more than "<code>typeof(b)</code> must be convertible to <code>typeof(c)</code> or vice versa, unambiguously" ?</p>
