Re: Abandonment of aggregate types
"SuperKoko" <tabkannaz@yahoo.fr> skrev i meddelandet
news:1156340459.919321.93260@74g2000cwt.googlegroups.com...
"Bo Persson" wrote:
"Frederick Gotham" <fgothamNO@SPAM.com> skrev i meddelandet
You want:
T *&p_t
No, you definitely want
T*& p_t
What's the difference? Whitespaces are optionnal here. It's only a
stylistical difference.
No, it's a religious thing. :-)
We have always wondered whether to write
int* p; // p is a pointer to an int
or
int *p; // *p is an integer
Or, even more important, do you write
const int i;
or
int const i;
??
Now Frederick said that *&p_t is of type T. I claim that p_t is
_obviously_ a reference to s pointer to T.
What if we add some const specifiers
T const*const&p_t
Now T is a type, and const*const&p_t is the name of the parameter?
Come on!
If you use the One True Style(tm), there is never a problem with
declarations. You first fully specify the type, and then the name.
mhhh, so, what's the meaning of:
int* p,q;
I don't know, I would never write anything like that.
First you specify the type, then the name, Why would you have two
names?
And how do you declare arrays, functions or pointer to functions?
int[42] x; // ??????
std::vector<int> x;
I wouldn't use x as a name anyway, it should be long and descriptive.
And using ProperCase, of course.
Don't forget the three spaces in between. :-)
Why? They're usually optional.
So the language standard isn't strict enough. It ought to be!
The base type must be specified first (not the full type), then a
comma-separated list of identifiers with type modifiers can be
specified.
Blasphemy!
(This time I looked the spelling up :-)
Bo Persson
---
[ 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.comeaucomputing.com/csc/faq.html ]