title: enable_if to conditionally include member functions
body: <p>I have a templated class, whose types are iterators.  I want to enable/disable particular member functions depending on the iterator_category of my template parameter.  In particular, I want to enable <code>operator--</code> if the template parameter is a bidirectional iterator.  My attempt was this:</p>
  
  <pre><code>    typename std::enable_if&lt;
         std::is_base_of&lt;std::bidirectional_iterator_tag,
                      MyTemplateParameter&gt;::value,
      MyType&amp;&gt;::type
      operator --() {
      //do work
      return *this;
    }
  </code></pre>
  
  <p>Clang tells me (roughly): <code>error: no type named 'type' in 'std::__1::enable_if&lt;false, MyTemplateParameter&gt;'; 'enable_if' cannot be used to disable this declaration</code></p>
  
  <p>Is there a way to accomplish what I'm trying?</p>
  
  <p>Here's the example in some context:</p>
  
  <pre><code>    #include &lt;iterator&gt;
      #include &lt;type_traits&gt;
  
      template &lt;typename TagType&gt; 
      class test {
        public:
        typename std::enable_if&lt;
           std::is_base_of&lt;std::bidirectional_iterator_tag,
                          TagType&gt;::value,
          test&gt;::type
        operator --() {
           return *this;
        }
  
      };
  
      int main(){
  
        test&lt;std::random_access_iterator_tag&gt; t1;
        test&lt;std::forward_iterator_tag&gt; t2;
  
      /*
      breakTemps.cpp:13:2: error: no type named 'type' in 'std::__1::enable_if&lt;false,     test&lt;std::__1::forward_iterator_tag&gt; &gt;'; 'enable_if' cannot be used to disable this declaration
              std::is_base_of&lt;std::bidirectional_iterator_tag,
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      breakTemps.cpp:25:35: note: in instantiation of template class 'test&lt;std::__1::forward_iterator_tag&gt;' requested here
         test&lt;std::forward_iterator_tag&gt; t2;
                                         ^
      */
  
  }
  </code></pre>