Skip to content

Instantly share code, notes, and snippets.

@aniketbiprojit
Created January 11, 2021 10:15
Show Gist options
  • Select an option

  • Save aniketbiprojit/ac8f859c85b6a376a1ea40986ee2504f to your computer and use it in GitHub Desktop.

Select an option

Save aniketbiprojit/ac8f859c85b6a376a1ea40986ee2504f to your computer and use it in GitHub Desktop.
Blog ET 3
template <typename T>
std::vector<T> operator+(std::vector<T> v1, std::vector<T> v2)
{
std::vector<T> v;
auto itr1 = v1.begin();
auto itr2 = v2.begin();
for (; itr1 < v1.end(); itr1++, itr2++)
{
v.push_back(*itr1 + *itr2);
}
return v;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment