On Sun, 2008-02-10 at 12:11 -0500, Howard Hinnant wrote:
> We're open to suggestions and participation.
How about:
Define #pragma push(new_array) to make new char[expr] return a pointer
to an object with type "char[expr]" if expr is a constexpr or =EF=BB=BFthe
incomplete type "char[]" otherwise, between a pragma push(new_array) and
its corresponding pop(new_array)?
Could you define element_cast(array) to be required within those regions
to make a reference to an array collapse into a pointer to the element
type along with defining element_cast(char[]) for type resolution,etc,
never collapsing to a pointer without element_cast for any caller or
callee in one of those new_array regions of any translation unit. And
allow objects to have the incomplete type char[] (or rather, allow
references and pointers to objects to have the types char (&)[] and char
(*)[] and just forbid definition of objects like char[] in places like
class definitions or with auto storage but allowing references and
pointers to such objects in those places.
=EF=BB=BFOh yeah, redefine ary[6] within the new_array regions from *(ary+6=
) to
*(element_cast(ary) + 6).
What are the difficult corner cases? After sorting them out, all we need
is to wait until 2019.
--=20
Tristan Wibberley
Any opinion expressed is mine (or else I'm playing devils advocate for
the sake of a good argument). My employer had nothing to do with this
communication.