title: make function accept function pointers or lambda functions with the correct argument types only
body: <p>I've got two functions defined:</p>
  <p><code>std::vector&lt;ptr&gt; find(const ptr&amp;, const std::function&lt;bool(const ptr&amp;)&gt;&amp;, const std::function&lt;bool(const ptr&amp;)&gt;&amp;);</code></p>
  <p>and</p>
  <p><code>std::vector&lt;ptr&gt; find(const ptr&amp;, const std::function&lt;bool(const ptr&amp;)&gt;&amp;, const std::function&lt;bool(const std::vector&lt;ptr&gt;&amp;)&gt;&amp;);</code></p>
  <p>I'm trying to rewrite them as template function accepting template arguments for the functions, in order to avoid new/delete for the std::function and avoiding calling via a virtual function.</p>
  <p><code>template&lt;typename CHECK, typename DIVE&gt;std::vector&lt;ptr&gt; find(const ptr&amp;, const CHECK&amp;, const DIVE&amp;);</code></p>
  <p>But the compiler gets confused as the template definition for both functions is identical. Is there some way to do this -- e.g. by using some static_assert that the argument must be convertable to a std::function with a certain argument set?</p>
  <p>I'm bound to C++11...</p>