Skip to content

Instantly share code, notes, and snippets.

@JohanMabille
Created January 7, 2020 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohanMabille/c80962cb89c43ce4b726f4a54909fb1f to your computer and use it in GitHub Desktop.
Save JohanMabille/c80962cb89c43ce4b726f4a54909fb1f to your computer and use it in GitHub Desktop.
template <class T, class S>
void nested_copy(T& iter, const S& s)
{
*iter++ = s;
}
template <class T, class S>
void nested_copy(T& iter, std::initializer_list<S> s)
{
for(auto it = s.begin(); it != s.end(); ++it)
{
nested_copy(iter, *it);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment