473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

what is the name of operator ->

Doe s operator -have a name? Like bool operator <(..) is named the
less-than operator.

Aug 13 '06 #1
8 3227
posted:
Doe s operator -have a name? Like bool operator <(..) is named the
less-than operator.

I call it the "operator for member selection via pointer", or perhaps just
"the arrow operator".

--

Frederick Gotham
Aug 13 '06 #2

Frederick Gotham wrote:
posted:
Doe s operator -have a name? Like bool operator <(..) is named the
less-than operator.


I call it the "operator for member selection via pointer", or perhaps just
"the arrow operator".

--

Frederick Gotham
Thanks; Does C++ standard have this name? Do you know?

Aug 13 '06 #3

<mo********@yahoo.comskrev i meddelandet
news:11**********************@h48g2000cwc.googlegr oups.com...
>
Frederick Gotham wrote:
>posted:
Doe s operator -have a name? Like bool operator <(..) is named
the
less-than operator.


I call it the "operator for member selection via pointer", or
perhaps just
"the arrow operator".

--

Frederick Gotham
Thanks; Does C++ standard have this name? Do you know?
The standard document refers to it literally as "the -operator", or
sometimes as "arrow".
Bo Persson
Aug 13 '06 #4

mo********@yahoo.com wrote:
Doe s operator -have a name? Like bool operator <(..) is named the
less-than operator.
The "class member access" operator.

Greg

Aug 14 '06 #5
In article <11**********************@h48g2000cwc.googlegroups .com>,
mo********@yahoo.com says...

[ ... ]
Doe s operator -have a name? Like bool operator <(..) is named the
less-than operator.
[ ... ]
Thanks; Does C++ standard have this name? Do you know?
Sort of. What it says is ($5.2.5):

A postfix expression followed by a dot . or an arrow ->,
optionally followed by the keyword template (14.8.1), and
then followed by an id-expression, is a postfix
expression.

I guess based on that you could call it the "arrow operator", but the
standard almost goes out of its way to avoid that term (or any other).

--
Later,
Jerry.

The universe is a figment of its own imagination.
Aug 14 '06 #6
Jerry Coffin wrote:
In article <11**********************@h48g2000cwc.googlegroups .com>,
mo********@yahoo.com says...

[ ... ]
>>>Doe s operator -have a name? Like bool operator <(..) is named the
less-than operator.
[ ... ]
>Thanks; Does C++ standard have this name? Do you know?

Sort of. What it says is ($5.2.5):

A postfix expression followed by a dot . or an arrow ->,
optionally followed by the keyword template (14.8.1), and
then followed by an id-expression, is a postfix
expression.

I guess based on that you could call it the "arrow operator", but the
standard almost goes out of its way to avoid that term (or any other).
I tend to "read" it as "pointing at", since I learned it from C back in
1984, and it was used with pointers.

But I don't believe the Standard has any "official" name, short of what
Jerry post it.
Aug 14 '06 #7
red floyd wrote:
[..]
I tend to "read" it as "pointing at", since I learned it from C back
in 1984, and it was used with pointers.

But I don't believe the Standard has any "official" name, short of
what Jerry post it.
The caption of 5.2.5 is "Class member access". I've seen the term "member
access for pointer" used when referring to the "arrow" operator, '->'. At
the same time, the paragraph 2 of the same subclause uses the term "arrow"
(in parentheses) when talking about the "second option", i.e. the '->'.
So, both names are pretty official.

Also, 13.5.6 (which is about overloading of 'operator->') is titled as
"Class member access".

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 14 '06 #8
Jerry Coffin wrote:
In article <11**********************@h48g2000cwc.googlegroups .com>,
mo********@yahoo.com says...

[ ... ]
Doe s operator -have a name?
I guess based on that you could call it the "arrow operator", but the
standard almost goes out of its way to avoid that term (or any other).

That's true of the C standard as well, it just uses -whenever it
wants to refer to the operator. I didn't see any other name used,
although I didn't make an exhaustive search.

I guess it's not too surprising, had C called it something C++ would
probably have used the same nomenclature.

Brian
Aug 14 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: Steven Bethard | last post by:
I thought it might be useful to put the recent lambda threads into perspective a bit. I was wondering what lambda gets used for in "real" code, so I grepped my Python Lib directory. Here are some...
70
by: Roy Yao | last post by:
Does it mean "(sizeof(int))* (p)" or "sizeof( (int)(*p) )" ? According to my analysis, operator sizeof, (type) and * have the same precedence, and they combine from right to left. Then this...
3
by: John Cho | last post by:
/* This program is a database program that will store video tape names, minutes, year released, and price I want it to be professional so that *YOU* will want to buy it and use it for a video...
3
by: fastwings | last post by:
mm the code //////makemenu.h//// class menu { public: int op; pmenu(int op,int sub = 0) { switch op {
12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
22
by: Tony Johansson | last post by:
Hello Experts! I'm reading i a book about C++ and they mention infix with telling what it is. I hope you out there can do so. Many thanks! //Tony
11
by: Micha | last post by:
Hello there, I think I've run into some classic c++ pitfall and maybe some of you guys can help me out. For my project I will need to use matrices and vectors and so I decided to implement them...
24
by: Romeo Colacitti | last post by:
Hi, Does anyone here have a strong understanding for the meanings of the terms "lvalue" and "rvalue" as it pertains to C, objects, and different contexts? If so please share. I've been...
5
by: Phil Ward | last post by:
The following has recently arose and it is the first time I have noticed this behaviour. I have been using a self-defined string class. It's form is class CMyString { public: ... (no public...
11
by: Neo | last post by:
If i have a : typedef struct str32{ uint32_t word1; uint32_t word2; } word_array; word_array *my_array; what would be the data type of this: myarray->word1
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.