Skip to content

Instantly share code, notes, and snippets.

@wilhelmtell
Created April 13, 2010 08:12
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 wilhelmtell/364415 to your computer and use it in GitHub Desktop.
Save wilhelmtell/364415 to your computer and use it in GitHub Desktop.
template<typename T, size_t N>
T* end_of(T (&arr)[N])
{
return &arr[0]+N;
}
// ...
int arr[42];
std::fill(arr, end_of(arr), 25);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment