Archive for September, 2010
Reference to array
By chys on September 26th, 2010I 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: C/C++
