title: STL std::transform
body: <p>The transform() algorithm has two forms, i am fine with the first one.</p>
  
  <p>Here is the template specification for the second one:</p>
  
  <pre><code>template &lt;class InputIterator1, class InputIterator2,
            class OutputIterator, class BinaryOperation&gt;
    OutputIterator transform (InputIterator1 first1, InputIterator1 last1,
                              InputIterator2 first2, OutputIterator result,
                              BinaryOperation binary_op);
  </code></pre>
  
  <p>My book says,</p>
  
  <blockquote>
    <p>In the second form, the transformation is applied using a binary
    operator function that receives the value of an element from the
    sequence to be transformed as in its first parameter and an element
    from the second sequence as its second parameter.</p>
  </blockquote>
  
  <p>q1. Why is there no input iterator parameter for the second sequence indicating the end of second sequence? i.e Why is there no <code>InputIterator last2</code> parameter in the <code>transform()</code>?</p>
  
  <p>q2. What happens when the length of the first and second sequence is unequal?</p>
  
  <p>q3. The blockquoted text says <strong>binary operator function</strong>. So what does that operator function mean in this context? Isn't any binary function valid? </p>