title: Nested Pass by Reference
body: <p>I need to have a nested pass by reference.</p>
  
  <p><strong>EDITED TO INCLUDE ACTUAL CODE</strong></p>
  
  <p>Exact error is:</p>
  
  <blockquote>
    <p>no matching function for call to ‘CLItem::getValue(std::string*&amp;)’</p>
  </blockquote>
  
  <p>Complete error is:</p>
  
  <pre><code>App/CycCmdLine.cpp: In member function ‘std::string CycCmdLine::getEnvironment()’:
  App/CycCmdLine.cpp:245: error: no matching function for call to ‘CycCmdLine::getValue(const char [16], std::string&amp;)’
  ./../CmdLine/CmdLine.h: In member function ‘bool CmdLine::getValue(std::string, T&amp;) [with T = std::string*]’:
  App/CycCmdLine.cpp:384:   instantiated from here
  ./../CmdLine/CmdLine.h:237: error: no matching function for call to ‘CLItem::getValue(std::string*&amp;)’
  ./../CmdLine/CmdLine.h:145: note: candidates are: bool CLItem::getValue(bool&amp;)
  ./../CmdLine/CmdLine.h:146: note:                 bool CLItem::getValue(std::string&amp;)
  ./../CmdLine/CmdLine.h:147: note:                 bool CLItem::getValue(long unsigned int&amp;)
  ./../CmdLine/CmdLine.h:148: note:                 bool CLItem::getValue(std::list&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;&amp;)
  ./../CmdLine/CmdLine.h:149: note:                 bool CLItem::getValue(std::list&lt;std::list&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;, std::allocator&lt;std::list&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt; &gt;&amp;)
  </code></pre>
  
  <p>Updated code:</p>
  
  <pre><code>// initial caller
  string CycCmdLine::getEnvironment()
  {
      string sRet="";
      do
      {     
          if(hasLogFile())
              {
                  string sLogFile="";
                  getValue(CYCCMD_CMDSTR_LOGFILE, sLogFile);
                  sRet+="\n  -Profiler logfile: "+sLogFile;
              }
      }while(false);
      return(sRet);
  }
  
  // CmdLine::getValue function definition (this is in the header file, as a template should be)
  template &lt;typename T&gt;
  bool CmdLine::getValue(string sName, T &amp;tValue)
  {
      bool bRet=false;
      do
      {
      // try to get the iterator
      bool bExists;
      map&lt;string, CLItem*&gt;::iterator itItr;
      bExists=getMapElement(sName, itItr);
  
          // go ahead and return the value
          if(!itItr-&gt;second-&gt;getValue(tValue)) { break; }
          bRet=true;
      }while(false);
      return(bRet);
  }
  
  bool CLItem::getValue(string&amp; sValue)
  {
      bool bRet=false;
      do
      {
          // is this the correct type?
          if(!isType(CLType_STRING)) { break; }
  
          // return the value
          sValue=m_sValue;
          bRet=true;
      }while(false);
      return(bRet);
  }
  </code></pre>