title: std::bind used in function template issue
body: <p>Consider the follow code:</p>
  
  <pre><code>Unit&amp; accessTree(std::string unitId2Find,  BSTree&lt;Unit&gt; &amp;tree)
  {
      Unit searchU;
      searchU.SetId(unitId2Find);
      return tree.search(searchU);
  }
  
  int main()
  {
      using namespace std::placeholders;
      BSTree&lt;Unit&gt; tesTree;
      auto getUnit = std::bind(accessTree, _1, std::cref(tesTree));'
  
      Registration R;
  
  ..... //Setting required data
  
  int i = R.GetCredits(getUnit); //Causes the error.
  </code></pre>
  
  <p>Now I've tried two different types of implementation:
  1</p>
  
  <pre><code>template&lt;typename Fn&gt;
  unsigned Registration::GetCredits(Fn access)
  {
      unsigned sum = 0;
      for(unsigned i = 0; i &lt; GetSize(); i++)
          sum += results[i].GetCredits(access(results[i].GetUnit()));
  
      return sum;
  }
  
  template&lt;typename Fn&gt;
  float Registration::CalculateGPA(Fn access)
  {
      float total = 0;
  
      for (int i = 0; i &lt; results.getLength(); i++)
      {
          total = total + results[i].GetGPAvalue() * results[i].GetCredits(access(results[i].GetUnit()));
      }
  
      return total / GetCredits(access);
  }
  </code></pre>
  
  <p>2</p>
  
  <pre><code>unsigned Registration::GetCredits(Unit&amp; (*access) (std::string &amp; uId))
  {
      unsigned sum = 0;
      for(unsigned i = 0; i &lt; GetSize(); i++)
          sum += results[i].GetCredits(*access(results[i].GetUnit()));
  
      return sum;
  }
  
  float Registration::CalculateGPA(Unit&amp; (*access) (std::string &amp; uId))
  {
      float total = 0;
  
      for (int i = 0; i &lt; results.getLength(); i++)
      {
          total = total + results[i].GetGPAvalue() * results[i].GetCredits(*access(results[i].GetUnit()));
      }
  
      return total / GetCredits(func);
  }
  </code></pre>
  
  <p>Compiler:
  ||=== Build: Debug in TesterProgram (compiler: GNU GCC Compiler) ===|
  E:\CODE\DSA\TesterProgram\BSTree.h||In member function 'elemType&amp; BSTree::search(const elemType&amp;) const [with elemType = Unit]':|
  E:\CODE\DSA\TesterProgram\BSTree.h|189|warning: control reaches end of non-void function [-Wreturn-type]|
  E:\CODE\DSA\TesterProgram\src\Regist.cpp||In member function 'Vector&amp; Registration::GetHighestResults()':|
  E:\CODE\DSA\TesterProgram\src\Regist.cpp|100|warning: reference to local variable 'vec' returned [-Wreturn-local-addr]|
  E:\CODE\DSA\TesterProgram\src\Regist.cpp||In member function 'Vector&amp; Registration::GetLowestResults()':|
  E:\CODE\DSA\TesterProgram\src\Regist.cpp|125|warning: reference to local variable 'vec' returned [-Wreturn-local-addr]|
  ..\TesterProgram\vector.h||In member function 'const T&amp; Vector::operator[](unsigned int) const [with T = Result]':|
  ..\TesterProgram\vector.h|277|warning: control reaches end of non-void function [-Wreturn-type]|
  obj\Debug\main.o||In function <code>main':|
  E:\CODE\DSA\TesterProgram\main.cpp|81|undefined reference to</code>unsigned int Registration::GetCredits(std::_Placeholder&lt;1>, std::reference_wrapper const>))(std::string, BSTree&amp;)> >(std::_Bind(std::_Placeholder&lt;1>, std::reference_wrapper const>))(std::string, BSTree&amp;)>)'|
  ||=== Build failed: 1 error(s), 4 warning(s) (0 minute(s), 0 second(s)) ===|</p>
  
  <p>What is going on here, I've had a look at related stuff on this site but nothing seems to directly answer this question.</p>
  
  <p>I don't know how to use boost:: Is this something that is required, how would it be used?</p>
  
  <p>Or is this a run time/ compiler issue? Is it not define in the compilation process when it needs to be? Is there a work around?</p>
  
  <p>Thanks SO</p>
  
  <p>Working on MVCE now.. update soon</p>