Quote Originally Posted by PredicateNormative View Post
Something like this should do it:

Code:
template <typename T, size_t U> 
size_t size(T (&arr)[U])
{
    return sizeof(arr)/sizeof(arr[0]);
}
That's kind of redundant, don't you think? You already have the size (in the form of U).
See the second snippet in my original post for what I mean.