Solved

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

Posted on 2015-01-24
4
98 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 500 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 500 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

626 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