What is T*VQ&

D

dwaach

what does T*VQ& mean where

T is object type,
VQ is volatile or empty,

Is this correct,

struct X {};

volatile X ox;
X* px=&ox;

Help
Dwaach.
 
J

Jonathan Mcdougall

what does T*VQ& mean where
T is object type,
VQ is volatile or empty,

If I understand your question correctly,

T *VQ& o;

would mean that 'o' is a [volatile] reference to a pointer to a T.
Is this correct,
struct X {};

volatile X ox;
X* px=&ox;

What are you asking? Does this compile? Yes it does.


Jonathan
 
V

Victor Bazarov

dwaach said:
what does T*VQ& mean where

T is object type,
VQ is volatile or empty,

It's a declarator of a [volatile or plain] pointer to an object of T.
Is this correct,

struct X {};

volatile X ox;

ox is a volatile object of type X.
X* px=&ox;

px is a regular pointer to an object of type X. You attempt to initialise
it with the address of a volatile object, which is not allowed. You can
only expect the compiler to convert from a pointer to a less-qualified to
more-qualified object. IOW, legal implicit conversions include

[] -> const
[] -> volatile
const -> const volatile
volatile -> const volatile

where [] means "noting" or "plain".

V
 
V

Victor Bazarov

Victor said:
dwaach said:
what does T*VQ& mean where

T is object type,
VQ is volatile or empty,


It's a declarator of a [volatile or plain] pointer to an object of T.

My mistake. Should of course be

It's a declarator of a reference to a [volatile or plain] pointer to
an object of T.

V
 
J

Jonathan Mcdougall

Victor said:
Jonathan said:

It is customary, Jonathan, to leave the name of the previous poster in
so that people knew to whom you're replying...

Unfortunately, Google groups does not quote the message when anwering.
It has to be done manually and this is something I forgot to do. All my
excuses Victor.
No, it does not. Go check.

Cannot convert from volatile X* to X*, yeah, I know. Back to bed.


Jonathan
 
B

Bart

Jonathan said:
Victor Bazarov wrote:
Jonathan said:

It is customary, Jonathan, to leave the name of the previous poster in
so that people knew to whom you're replying...

Unfortunately, Google groups does not quote the message when anwering.
It has to be done manually and this is something I forgot to do. All my
excuses Victor.

It does. Click on "show options" next to the name of the poster you
want to reply to, and then choose "Reply" from the options. If you just
click on the reply at the bottom of the post you won't have any quoted
text.
 
J

Jonathan Mcdougall

Bart said:
Jonathan said:
Victor said:
Jonathan Mcdougall wrote:
[...]

It is customary, Jonathan, to leave the name of the previous poster in
so that people knew to whom you're replying...

Unfortunately, Google groups does not quote the message when anwering.
It has to be done manually and this is something I forgot to do. All my
excuses Victor.

It does. Click on "show options" next to the name of the poster you
want to reply to, and then choose "Reply" from the options. If you just
click on the reply at the bottom of the post you won't have any quoted
text.

Dang.


Jonathan
 
D

dwaach

Hi, Jonathan,Victor and Bart

Thanks a lot for the great help.

Things are getting clear now...

Good day !
Dwaach...
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top