title: Finding the indexes of all occurrences of an element in a vector
body: <p>Suppose I have a vector <code>A = {1 0 1 1 0 0 0 1 0}</code>. Now I want to get the indexes of all occurrences of 0 returned as another vector <code>B</code>. </p>
  
  <pre><code>template&lt; class InputIt, class T&gt;
  std::vector&lt;int&gt; IndicesOf(InputIt first, InputIt last, const T&amp; value) {
  
  }
  </code></pre>
  
  <p>Here is a start:</p>
  
  <pre><code>std::vector&lt;int&gt;::iterator iter = std::find_if(A.begin(), A.end(), 0);
  B = std::distance(A.begin(), iter);
  </code></pre>