This is the mail archive of the
mailing list for the GCC project.
Re: request for new a syntactic design for C/C++.
- From: Ian Lance Taylor <iant at google dot com>
- To: "Vladimir 'Yu' Stepanov" <vys at renet dot ru>
- Cc: gcc at gcc dot gnu dot org
- Date: 10 Jul 2006 09:40:38 -0700
- Subject: Re: request for new a syntactic design for C/C++.
- References: <44B1EB23.email@example.com>
"Vladimir 'Yu' Stepanov" <firstname.lastname@example.org> writes:
> Current syntax C/C++:
> load_ptr = typeof(load_ptr)(((char *)init_ptr) - \
> offsetof(typeof(init_ptr), field);
> The offered syntax:
> &load_ptr->field = init_ptr;
Interesting idea, but C/C++ programmers expect that an assignment sets
the entire expression on the left of the '='. So I don't think this
is a good syntax.
In fact you can already write what you want with a macro, one quite
similar to offsetof, so I don't think we need any new syntactic sugar
> struct some_struct &link = other;
This already means something in C++: it means to create a reference.