This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: two ideas to improve C++
- From: Laurent Rineau <laurent dot rineau_gcc at normalesup dot org>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 22 Oct 2009 11:51:17 +0200
- Subject: Re: two ideas to improve C++
- References: <4ADE5CC2.80409@szpilewski.opole.pl>
On Wednesday 21 October 2009 02:58:42 Ireneusz Szpilewski wrote:
> Current status of void is somewhat strange. It is a type but you cannot
> create objects of type void.
> So, it is type of what? But you can have memory pointer to void, so
> object (or array) of type void
> has its memory position but cannot be here created. Pointer arithmetics
> for void* is forbidden.
> Despite this all, we are allowed to use void as a template type
> parameter. It is not elegant and
> makes C/C++ harder to understand for beginners.
void is, by definition, an "incomplete type". That explains all why you said.
Re-read the C++ norm about incomplete types. If, after that read, you still
feel the need to discuss, find out a mailing list, a forum, or a Usenet group,
about C++. gcc@gcc.gnu.org is not the right list for such a discussion.