Suppose I have a template function <br><br>template&lt;typename T&gt; void f(const std::string&amp;, T);<br><br>which I want there to be a couple of different variants of.  <br><br>Version 1 - Enabled if and only if boost::is_same&lt;T, bool&gt;<br>
Version 2 - Enabled if and only if boost::is_same&lt;T, foo&gt;  (foo is a class)<br>Version 3 - Enabled if and only if boost::is_enum&lt;T&gt;<br>Version 4 - Otherwise<br><br>Is there an easy way to express this?  It seems I run into a bunch of overload ambiguity problems.  I&#39;m sure I can get around this by adding to every version the negation of all the other conditions, but this seems unnecessarily complicated.<br>

