title: c++ multiple interfaces to the same functionality template
body: <p>I have several methods that work over utf8 encoded strings that I usually keep in std::string.</p>
  
  <p>In same cases though I just have const char* to the data, or the data is part of a bigger string I do not want to create a substring.</p>
  
  <p>All the functionality boils down to one generic method say:</p>
  
  <pre><code>void foo(int a, int b, const char* beginStr, const char* endStr);
  </code></pre>
  
  <p>Now if I would like to avoid some ugliness I will create</p>
  
  <pre><code>void foo(int a, int b, const char* beginStr, const char* endStr);
  void foo(int a, int b, const char* str);
  void foo(int a, int b, const std::string% str);
  </code></pre>
  
  <p>and in some cases even:</p>
  
  <pre><code>void foo(int a, int b, const std::string::const_iterator&amp; beginStr
                         const std::string::const_iterator&amp; endStr);
  </code></pre>
  
  <p>This seems Ok, but as I mentioned I have several methods and it gets really annoying maintaining all these flavors.</p>
  
  <p>What I am looking is some magic that could eliminate the need of multiplying every interface. Can some of the c++11 features help with solving this without performance impact - making it less chaty? </p>