 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Hwang, Sung Jin Guest
|
Posted: Wed Apr 27, 2005 5:55 am Post subject: Some questions on the decltype/auto proposal. |
|
|
1. For decltype, what happened to the common name typeof?
Isn't typeof consistent with sizeof operator?
2. I am glad that a proposal for specifying return type of
a function at the tail of a function declaration.
But... do compilers need a keyword ahead of function
declarations to parse them correctly? (The proposal placed
the 'auto' keyword.)
In addition why does the proposal use operator-> to
specify the return type? isn't 'return' keyword better?
There would be no parsing problems with using 'return' keyword
and it would be more intuitive.
To me, the proposal is weird. Does anyone know why?
---
[ 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 ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Francis Glassborow Guest
|
Posted: Wed Apr 27, 2005 6:31 pm Post subject: Re: Some questions on the decltype/auto proposal. |
|
|
In article <198ea225.0504260056.1006d7ef (AT) posting (DOT) google.com>, "Hwang,
Sung Jin" <serikas (AT) gmail (DOT) com> writes
| Quote: | 1. For decltype, what happened to the common name typeof?
Isn't typeof consistent with sizeof operator?
2. I am glad that a proposal for specifying return type of
a function at the tail of a function declaration.
But... do compilers need a keyword ahead of function
declarations to parse them correctly? (The proposal placed
the 'auto' keyword.)
In addition why does the proposal use operator-> to
specify the return type? isn't 'return' keyword better?
There would be no parsing problems with using 'return' keyword
and it would be more intuitive.
To me, the proposal is weird. Does anyone know why?
|
The answer to all your questions come down to:
1) Investigating the concepts for which 'typeof' has been used revealed
that there are several concepts in the bundle which need to be teased
apart. Using typeof for just one of them was just going to sow confusion
among people who are currently using some variety of 'typeof' extension.
2) C++ is already a fiercely difficult language to parse so adding clues
for the parser can be of considerable help. The problem isn't in parsing
correct code but identifying incorrect code (and if you want to see how
bad that can get, look at error messages that result from template use)
3)The exact syntax has not yet been settled (it takes much longer than
some people expect because we are trying to ensure that the final result
is clear and easy to use)
--
Francis Glassborow ACCU
Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
For project ideas and contributions: http://www.spellen.org/youcandoit/projects
---
[ 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 ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|