Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

26. What operations can not be overloaded? How do you think, why?

Posted on 2015-01-24
4
Medium Priority
?
109 Views
Last Modified: 2015-03-17
What operations can not be overloaded? How do you think, why?
0
Comment
Question by:Nusrat Nuriyev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 40568260
The operators that cannot be overloaded are



.
 Member selection
 
.*
 Pointer-to-member selection
 
::
 Scope resolution
 
? :
 Conditional
 
#
 Preprocessor convert to string
 
##
 Preprocessor concatenate

Source: https://msdn.microsoft.com/en-us/library/5tk49fh2.aspx 

Sorry about the copy&paste, they were just to many to write down ;o)
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 2000 total points
ID: 40568262
Ooops, forgot the "Why?" part - Bjarne answers that here: http://www.stroustrup.com/bs_faq2.html#overload-dot
And I won't copy that here, since I had to look that up myself ;o)
0
 

Author Comment

by:Nusrat Nuriyev
ID: 40606139
Okay :)
0
 

Author Comment

by:Nusrat Nuriyev
ID: 40670583
	class Y {
	public:
		void f();
		// ...
	};

	class X {	// assume that you can overload .
		Y* p;
		Y& operator.() { return *p; }
		void f();
		// ...
	};

	void g(X& x)
	{
		x.f();	// X::f or Y::f or error?
	}

Open in new window


I don't get this example, could you help?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question