Topic: ->" and "." no longer part of type specifier?


Author: Alexandre Oliva <oliva@dcc.unicamp.br>
Date: 1997/02/10
Raw View
John Lilley writes:

> Fergus Henderson wrote:
>>
>> Is parsing `typeof(a)::I i' easier?
>> [ than a.I ]

> I think you mean typeid?  typeid does not produce something that can be
> used as a type in the declaration-specifiers.

I think he really meant typeof.  It is a GNU C/C++ extensions which
allows a type to be referred to, given an expression of that type.  It
is quite useful, sometimes, and actually much easier to parse than the
suggested a.I, anyway.

--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
Universidade Estadual de Campinas, SP, Brasil
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]





Author: John Lilley <jlilley@empathy.com>
Date: 1997/02/04
Raw View
Fergus Henderson wrote:
>
> Is parsing `typeof(a)::I i' easier?
> [ than a.I ]

I think you mean typeid?  typeid does not produce something that can be
used as a type in the declaration-specifiers.  It produces a run-time
data structure that describes a type.  But, if what you said actually
existed, it would still be much easier than a.I because a.I looks like
an expression until you are completely finished.  I'm glad that I don't
have to deal with any of the above.

john lilley


[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]





Author: John Lilley <jlilley@empathy.com>
Date: 1997/01/30
Raw View
Hi,

I've been perusing the dec96 draft, and noticed that something in the
may96 draft seems to have been removed, or at least I *think* it used to
be there.  I could have sworn that somewhere I saw the use of something
like:

   class A { typedef int I };
   A a;
   a.I i;

In other words, being able to use a type member of a class object (or
pointer-to-class) as the type-specifier in a declaration.  Was this
removed?  Did it never exist and I just had a bad dream?  I would really
like to not implement this in my parser.

john lilley
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]





Author: fjh@murlibobo.cs.mu.OZ.AU (Fergus Henderson)
Date: 1997/02/01
Raw View
John Lilley <jlilley@empathy.com> writes:

>I could have sworn that somewhere I saw the use of something like:
>
>   class A { typedef int I };
>   A a;
>   a.I i;
>
>In other words, being able to use a type member of a class object (or
>pointer-to-class) as the type-specifier in a declaration.  Was this
>removed?  Did it never exist and I just had a bad dream?

Yes, it never existed, and you just had a bad dream.

>I would really like to not implement this in my parser.

It's a pity that parsing stuff like this is difficult, since the
above syntax is very intuitive and would often make better sense
than alternative `A::I i;', particularly when `A' is really
`some_complicated_template_type<some_complicated_other_type>'.
It would be nice if you could reduce the number of places
in which you need to hard-code the type of a given variable.

Is parsing `typeof(a)::I i' easier?

--
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.


[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]