title: template type_trait function, accept container of a given type and/or derived type
body: <p>in my work we do a lot of pair programming, and i wrote a function that ONLY accepts containers of a SINGLE type or its derivates, but my co-worker is afraid it will fail code review because it looks so damn ugly and says there's gotta be a better way:</p>
  
  <p>here is the signature, the Fruit class is a base class that i renamed Fruit just for this thread:</p>
  
  <pre><code>template &lt;class Container&gt;
  typename enable_if&lt;is_base_of&lt;Fruit, typename remove_pointer&lt;typename Container::value_type&gt;::type&gt;::value, void&gt;::type
  processFruits(container&amp; fruits)
  {
      //process the elements and change them if needed. thats why no const
  }
  </code></pre>
  
  <p>what it does is: returns void and enables the function IF its a container AND the type inside the container is a Fruit and/or derivided of fruit. i also used std::remove_pointer because i needed to know the "type" of the pointer (the container will most likely have pointers).</p>
  
  <p>this compiles and works as intended, but as i said i don't know it its the best way to do it, it seems too verbose and might get cut of on code review.</p>
  
  <p>EDIT: this also accepts templated classes, don't have to be containers. is there a way i can limit it to only accept STL containers?</p>
  
  <p>any alternate ideas or is it fine like it is?
  thanks in advance.</p>