This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: typeid().name() for references
- To: "David J. Murray" <1dmurray at home dot com>
- Subject: Re: typeid().name() for references
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 11 Jun 1998 21:21:40 -0300
- Cc: egcs at cygnus dot com
- References: <357EF244.FA91D5B@home.com>
David J Murray <1dmurray@home.com> writes:
> Can anyone tell me why typeid(X&).name() == typeid(X).name() ? Is this
> the desired result?
Yes, [expr.typeid] says:
4 When typeid is applied to a type-id, [...] If the type of the type-
id is a reference type, the result of the typeid expression refers to
a type_info object representing the referenced type. [...]
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil