title: Type condition in C++ template class problem
body: <p>Using GCC 4.2.
  I have this metatemplate for conditional type:</p>
  
  <pre><code>template &lt;bool condition, typename Then, typename Else&gt;
  struct IF
  {
      typedef Then RET;
  };
  
  template &lt;class Then, class Else&gt;
  struct IF&lt;false, Then, Else&gt;
  {
      typedef Else RET;
  };
  </code></pre>
  
  <p>and when I use it like this:</p>
  
  <pre><code>template &lt;typename T&gt;
  class Param
  {
      IF&lt; sizeof(int)&lt;sizeof(long), long, int&gt;::RET  i;
  };
  </code></pre>
  
  <p>it works, but when I use it like this (trying to use template parameters):</p>
  
  <pre><code>template &lt;typename T&gt;
  class Param
  {
      IF&lt; sizeof(int)&lt;sizeof(long), T&amp;, T* &gt;::RET mParam;
  };
  </code></pre>
  
  <p>I am getting this error code:</p>
  
  <pre><code>error: type 'IF&lt;false, T&amp;, T*&gt;' is not derived from type 'Param&lt;T&gt;'
  </code></pre>
  
  <p>Why is it happening? How to solve it?
  Thanks in advance!</p>