Skip to content

Instantly share code, notes, and snippets.

@jiunbae
Created July 7, 2015 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jiunbae/1bcbba6009e5bb57e376 to your computer and use it in GitHub Desktop.
Save jiunbae/1bcbba6009e5bb57e376 to your computer and use it in GitHub Desktop.
template <typename type, typename std_type = std::allocator<type>>std::list<type, std_type> operator+(std::list<type, std_type> * operand, std::list<type> * operanded)
{
std::list<type> * list = new std::list<type>;
list.assign(operand.begin(), operand.end());
for_each(operanded.begin(), operanded.end(), [&list](type element)->void{ list.push_back(element); });
return list;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment