By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,925 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,925 IT Pros & Developers. It's quick & easy.

What is T*VQ&

P: n/a
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.

Jul 23 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
> 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

Jul 23 '05 #2

P: n/a
dwaach wrote:
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
Jul 23 '05 #3

P: n/a
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...
struct X {};

volatile X ox;
X* px=&ox;

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


No, it does not. Go check.

V
Jul 23 '05 #4

P: n/a
Victor Bazarov wrote:
dwaach wrote:
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
Jul 23 '05 #5

P: n/a
> Victor Bazarov wrote:
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.
struct X {};

volatile X ox;
X* px=&ox;
What are you asking? Does this compile? Yes it does.

No, it does not. Go check.


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

Jul 23 '05 #6

P: n/a
Jonathan Mcdougall wrote:
Victor Bazarov wrote:
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.

Jul 23 '05 #7

P: n/a
Bart wrote:
Jonathan Mcdougall wrote:
Victor Bazarov wrote:
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

Jul 23 '05 #8

P: n/a
Hi, Jonathan,Victor and Bart

Thanks a lot for the great help.

Things are getting clear now...

Good day !
Dwaach...

Jul 23 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.