V
vsgdp
Does this mean (T* const)& (i.e., a reference to a constant pointer to a T).
So the pointer is constant but not the object pointed to?
So the pointer is constant but not the object pointed to?
vsgdp said:Does this mean (T* const)& (i.e., a reference to a constant pointer
to a T). So the pointer is constant but not the object pointed to?
Here's my little rule in decoding types that works pretty well.vsgdp said:Does this mean (T* const)& (i.e., a reference to a constant pointer to a T).
So the pointer is constant but not the object pointed to?
Ron said:Here's my little rule in decoding types that works pretty well.
Find the identifier (this is the tricky part, but in this case
it is "a"). If you can go right, go right, if not go left (limits
caused by parens or running out of declaration).
In this case,
a // start at a
is a reference // go left find &
to a constant // go left const
pointer // left *
to type T // left again
My strategy deals with all aspects of the declaration not justDilip said:YOu probably know this already but didn't the Vandevoorde/Josuttis C++
Templates book mention an easier way to determine exactly what is const
in an expression?
Ron said:My strategy deals with all aspects of the declaration not justDilip said:YOu probably know this already but didn't the Vandevoorde/Josuttis C++
Templates book mention an easier way to determine exactly what is const
in an expression?
constness. It's useful when dealing with bizarre things like:
int (*foo[3])(int*);
Dilip said:Ron said:My strategy deals with all aspects of the declaration not justDilip said:YOu probably know this already but didn't the Vandevoorde/Josuttis
C++ Templates book mention an easier way to determine exactly what
is const in an expression?
constness. It's useful when dealing with bizarre things like:
int (*foo[3])(int*);
Uh oh.. is that a pointer to a function returning an int and taking as
argument a pointer to an integer array with 3 elements?
Dilip said:Ron said:My strategy deals with all aspects of the declaration not just
constness. It's useful when dealing with bizarre things like:
int (*foo[3])(int*);
Uh oh.. is that a pointer to a function returning an int and taking as
argument a pointer to an integer array with 3 elements?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.