title: When to use std::begin and std::end instead of container specific versions
body: <p>Are there any general preferences or rules that explain when container specific versions of begin and end should be used instead of free functions <code>std::begin</code> and <code>std::end</code>?</p>
  
  <p>It is my understanding that if the function is a template whereby the container type is a template parameter then <code>std::begin</code> and <code>std::end</code> should be used, i.e.:</p>
  
  <pre><code>template&lt;class T&gt; void do_stuff( const T&amp; t )
  {
      std::for_each( std::begin(t), std::end(t), /* some stuff */ );
  }
  </code></pre>
  
  <p>What about in other scenarios such as a standard / member function where the type of container is known? Is it still better practice to use <code>std::begin(cont)</code> and <code>std::end(cont)</code> or should the container's member functions <code>cont.begin()</code> and <code>cont.end()</code> be preferred?</p>
  
  <p>Am I correct in assuming that there is no benefit in performance by calling <code>cont.end()</code> over <code>std::end(cont)</code>?</p>