title: Why do C++ STL function calls need to be so verbose?
body: <p>Why can't calls to STL functions be more brief? I was looking at the following code snippet on <a href="http://en.cppreference.com/w/cpp/algorithm/transform" rel="noreferrer">cppreference.com</a>:</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;cctype&gt;
  #include &lt;algorithm&gt;
  #include &lt;iostream&gt;
  
  int main()
  {
      std::string s("hello");
      std::transform(s.begin(), s.end(), s.begin(),
                     [](unsigned char c) { return std::toupper(c); });
      std::cout &lt;&lt; s;
  }
  </code></pre>
  
  <p>It seems to me that it should be possible to make this call more brief. The first obvious thing would be to do away with the lambda:</p>
  
  <pre><code>std::string s("hello");
  std::transform(s.begin(), s.end(), s.begin(), std::toupper);
  std::cout &lt;&lt; s;
  </code></pre>
  
  <p>But this doesn't work. Since you usually want to convert a whole container it should be possible to just use that as a parameter:</p>
  
  <pre><code>std::string s("hello");
  std::transform(s, s.begin(), std::toupper);
  std::cout &lt;&lt; s;
  </code></pre>
  
  <p>You could also omit the output iterator to return the result by value:</p>
  
  <pre><code>std::string s("hello");
  std::cout &lt;&lt; std::transform(s, std::toupper);
  </code></pre>
  
  <p>At this point the temporary variable is unnecessary:</p>
  
  <pre><code>std::cout &lt;&lt; std::transform("hello"s, std::toupper);
  </code></pre>
  
  <p>With added readability:</p>
  
  <pre><code>using namespace std;
  cout &lt;&lt; transform("hello"s, toupper);
  </code></pre>
  
  <p>Wouldn't this be more readable and just nicer? Why weren't STL functions designed to allow writing brief code like this? Will it be possible to shorten these calls in a future version of the C++ standard?</p>