Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can any one explain the difference

Tags:

c++

c++11

n3035 says: (2010-02-16)

A variable is introduced by the declaration of an object. The variable's name denotes the object.

n3090 says: (2010-03-29)

A variable is introduced by the declaration of a reference other than a non-static data member or of an object. The variable's name denotes the reference or object.

n3242 says: (2011-02-28)

A variable is introduced by the declaration of a reference other than a non-static data member or of an object. The variable's name denotes the reference or object.

CAN any one explain the difference interms (or) with the help of an program(exactly what it say's)

this is the statement from ISO standard C++

I seen this link :

Why was the definition of a variable changed during the development of C++11?

but this is not(full meaning) my question ...

like image 749
1User Avatar asked Mar 22 '11 05:03

1User


People also ask

What is the difference between anyone any one?

When it means “anybody,” “anyone” is spelled as a single word: “anyone can enter the drawing.” But when it means “any single one,” “any one” is spelled as two words: “any one of the tickets may win.”

What is the difference between explain?

Meaning. Describe: Describe means to give a lot of details and paint a verbal picture of a situation or idea. Explain: Explain means to make an idea or situation clear to someone by describing it in more detail or revealing relevant facts.

Can you explain or could you explain?

'Could you' is more polite than 'Can you' and it sounds better - particularly if you are asking someone to do something for you.

What is the difference between some any?

The Main Difference Between SOME and ANY As a general rule, we use 'some' for affirmative sentences, and 'any' for questions or negative sentences. Usually, both 'some' and 'any' can only be used with countable plural nouns or uncountable nouns.


2 Answers

Consider:

int x = 42;
int& rx = x;

x is a variable; should rx also be considered a variable? Many of the Standard's requirements about non-reference variables also apply to references. It's obviously a pain to have to stipulate "variables or references to variables" constantly throughout the Standard, so if the definition of a variable can include references - perhaps with the occasional "except for references", then the Standard may be - on balance - simplified. It looks to me like the revisions were exploring this balance.

like image 197
Tony Delroy Avatar answered Sep 28 '22 04:09

Tony Delroy


This was a CWG defect #633 in ISO C++03

Also check out n2993 that deals with core issue# 633 i.e "Specifications for variables that should also apply to references"

The goal of these changes is to expand the meaning of "variable" to encompass both named objects and references, and to apply the term consistently wherever feasible.

like image 25
Prasoon Saurav Avatar answered Sep 28 '22 04:09

Prasoon Saurav