Archive for September, 2010

Reference to array

I recall Microsoft uses this trick in some of its headers. I believe it’s something like this:

template <size_t _Size> inline
char *strcpy (char (&dst)[_Size], const char *src)
{
    strcpy_s (dst, _Size, src);
    return dst;
}

Tags: