
On Wed, 28 Jan 2004 18:40:28 +0100, "Pavel Vozenilek" <pavel_vozenilek@hotmail.com> wrote:
"Gennaro Prota" <gennaro_prota@yahoo.com> wrote
Having a look to some old list messages I've seen there has been some discussion about discovering the number of elements of an array in compile-time. Sorry if I have simply misunderstood something here (I'm rapidly catching up with old threads), but isn't this enough?
Similar technique is used in container_traits library (written by Thorsten Ottosen).
Look for size_type.hpp, in sandbox or Files section. Use: n = sizeof(sizer(an_array))
I can't look at it right now, anyway I was just pointing out that it is possible (and easy), in case no one did that. Just one note: since this is a very elementary facility that concerns built-in arrays only I would prefer it to be indipendent from the container_traits library, if it will ever get into boost. Genny.