title: Using SFINAE in C++11 to choose between two functions with same signature
body: <p>I'm trying to use SFINAE in c++11 to select between two functions with the same signature, but different body based on the fact that there should be or not a <code>typedef</code> inside the given <code>T</code> type. For example, I have these two structs, one with MyTypedef defined and one that has nothing:</p>
  
  <pre><code>struct MyStruct1
  {
      typedef std::false_type MyTypedef;
  
      ...
  }
  
  struct MyStruct3
  {
      ...
  }
  </code></pre>
  
  <p>Then I have two template functions that should take the type of the struct as T and do different things based on the existence of <code>MyTypedef</code>. In particular, if <code>T::MyTypedef</code> is defined I should call the first function, in all other cases I should call the second function. I tried something like this:</p>
  
  <pre><code>template&lt;typename T&gt;
  void myFunction()
  {
      ...
  }
  
  template&lt;typename T, typename std::enable_if&lt;T::MyTypedef&gt;::type* = nullptr&gt;
  typename myFunction()
  {
      ...
  }
  </code></pre>
  
  <p>But it doesn't compile, error is C2668 (MSVC) - 'function' : ambiguous call to overloaded function</p>