This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] Implementation of C++0x decltype


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]