This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Implementation of C++0x decltype
- From: Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: doug dot gregor at gmail dot com (Douglas Gregor), gcc-patches at gcc dot gnu dot org
- Date: 03 Feb 2007 21:16:28 -0600
- Subject: Re: [C++ PATCH] Implementation of C++0x decltype
- References: <200702040255.l142tYWV024634@localhost.localdomain>
Andrew Pinski <pinskia@physics.uc.edu> writes:
| Can you explain the difference between typeof and decltype?
The simple answer is that decltype is reference preserving and
typeof is not. That has been extensively discussed at C++ committee
meetings, on C++ committee reflectors, and what you've got in the
reference given by Doug Gregor is what has acquired large consensus.
GNU typeof functionality is close to the "new meaning" of "auto" -- which
is already approved into the C++ Working Paper. I put "new meaning"
in quote because that meaning was implemented more than two decades
ago in Cfront but had to be taken out because some people were not
prepared yet for the idea of deducing the type of a variable from its
initializer.
The long answer is that you'd have to dig the archives, some of the
material are publically available as papers on decltype and auto on
the C++ committee website.
| Also it
| seems like all of the C++0x extensions that are implemented should
| have a mention in the documentation in a new section called something
| like C++0x working draft or something like that.
Agreed.
-- Gaby