title: How to call a templated function if it exists, and something else otherwise?
body: <p>I want to do something like</p>
  
  <pre><code>template &lt;typename T&gt;
  void foo(const T&amp; t) {
     IF bar(t) would compile
        bar(t);
     ELSE
        baz(t);
  }
  </code></pre>
  
  <p>I thought that something using <code>enable_if</code> would do the job here, splitting up <code>foo</code> into two pieces, but I can't seem to work out the details. What's the simplest way of achieving this?</p>