This is the mail archive of the gcc@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: typeof throws away the reference


Jari Petter Sundell <jaris@student.matnat.uio.no> writes:

| Compiling the following on g++-3.3 and 3.5-tree-ssa does not give a
| "could not convert `0' to ` int&'" for either of the assignments. Why
| doesn't typeof preserve the reference?

Because that is the way it was designed (parallel sizeof).
That is a known issue -- look for lengthy discussions on the boost
mailing lists. For the future, C++ will support reference- and
non-reference-preserving type queries.  Look for the last papers on
this issue (the last revision have splitted the auto proposal -- much
like typeof except you don't have to repeat expressions -- and
decltype -- much like typeof but preserves refernces).


-- 
                                                       Gabriel Dos Reis 
                                           gdr@integrable-solutions.net


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