title: std::lower_bound and std::find on a plain array
body: <p>I like to use <code>std::algorithm</code> whenever I can on plain arrays. Now I have 2 doubts; suppose I want to use <code>std::lower_bound</code> what happens if the value I provide as argument is not found?</p>
  
  <pre><code>int a[] = {1,2,3,4,5,6};
  int* f = std::lower_bound(a,a+6,20);
  </code></pre>
  
  <p>The result I have when printing *f is 20. </p>
  
  <p>The same happens if I use <code>std::find</code>.</p>
  
  <pre><code>int a[] = {1,2,3,4,5,6};
  int* f = std::find(a,a+6,20);
  </code></pre>
  
  <p>The result I have when printing *f is 20. </p>
  
  <ol>
  <li>Is it always the case that the return value is the original argument
  when this is not found? </li>
  <li>In terms of performance <code>std::lower_bound</code> performs better of <code>std::find</code> since it implements a binary search algorithm. If the array is big say max 10 elements, could std::find perform better? Behind the scenes std::lower_bound calls  std::advance and std::distance ..maybe I might save on these calls as well?</li>
  </ol>
  
  <p>Thanks a lot</p>
  
  <p>AFG</p>