message: [XLA] Fix signatures of c_foo functions and add c_any_of.
  Embarrassingly, we were often copying the container in c_foo.  Oops.
  This fixes that, and also adds some perfect forwarding that was missing.
  It also adds a c_any_of function.
diff: @@ -427,30 +427,37 @@ std::vector<std::pair<int64, int64>> CommonFactors(
  string SanitizeFileName(string file_name);
  template <typename Container, typename Predicate>
  -bool c_all_of(Container container, Predicate&& predicate) {
  +bool c_all_of(const Container& container, Predicate&& predicate) {
  return std::all_of(std::begin(container), std::end(container),
  std::forward<Predicate>(predicate));
  }
  +template <typename Container, typename Predicate>
  +bool c_any_of(const Container& container, Predicate&& predicate) {
  + return std::any_of(std::begin(container), std::end(container),
  + std::forward<Predicate>(predicate));
  +}
  +
  template <typename InputContainer, typename OutputIterator,
  typename UnaryOperation>
  -OutputIterator c_transform(InputContainer input_container,
  +OutputIterator c_transform(const InputContainer& input_container,
  OutputIterator output_iterator,
  - UnaryOperation unary_op) {
  + UnaryOperation&& unary_op) {
  return std::transform(std::begin(input_container), std::end(input_container),
  - output_iterator, unary_op);
  + output_iterator,
  + std::forward<UnaryOperation>(unary_op));
  }
  template <class InputContainer, class OutputIterator, class UnaryPredicate>
  -OutputIterator c_copy_if(InputContainer input_container,
  +OutputIterator c_copy_if(const InputContainer& input_container,
  OutputIterator output_iterator,
  - UnaryPredicate predicate) {
  + UnaryPredicate&& predicate) {
  return std::copy_if(std::begin(input_container), std::end(input_container),
  - output_iterator, predicate);
  + output_iterator, std::forward<UnaryPredicate>(predicate));
  }
  template <class InputContainer, class OutputIterator>
  -OutputIterator c_copy(InputContainer input_container,
  +OutputIterator c_copy(const InputContainer& input_container,
  OutputIterator output_iterator) {
  return std::copy(std::begin(input_container), std::end(input_container),
  output_iterator);
  @@ -468,7 +475,7 @@ void c_sort(InputContainer& input_container, Comparator&& comparator) {
  }
  template <typename Sequence, typename T>
  -bool c_binary_search(Sequence& sequence, T&& value) {
  +bool c_binary_search(const Sequence& sequence, T&& value) {
  return std::binary_search(std::begin(sequence), std::end(sequence),
  std::forward<T>(value));
  }
  