?
Solved

27. Can we overload operations for internal data types?

Posted on 2015-01-24
5
Medium Priority
?
55 Views
Last Modified: 2015-03-18
Can we overload operations for internal data types?
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
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 40568265
That pretty much goes with your 'operator overloading' question at http://www.experts-exchange.com/Programming/Languages/CPP/Q_28603163.html - yes, you can overload all operators, except the ones listed there. See http://en.wikibooks.org/wiki/C%2B%2B_Programming/Operators/Operator_Overloading for a comprehensive list how to overload each operator.
0
 

Author Comment

by:Nusrat Nuriyev
ID: 40606140
okay, let me see those links
0
 

Author Comment

by:Nusrat Nuriyev
ID: 40670594
I'm little bit confused. So there are two things operator overloading and operation overloading?
0
 
LVL 86

Expert Comment

by:jkr
ID: 40671205
Well, maybe I was on the wrong track, I really thought you meant 'operators' as well. If you meeen 'operations' as in 'method' calls - yes, that also, if you refer to an 'internal type' as e.g. a class/struct embedded in another class such as

class Foo {

  struct Bar {

    int x;
    int y;
  };

};

Open in new window

0
 

Author Comment

by:Nusrat Nuriyev
ID: 40674674
The answer is:
No, because datatype - is a set of data and operations over that. Changing semantics of datatype, we change the definition of type.

Ok, seems I have mistranslated the question from russian. It was about plain data types(not "internal types") like. Maybe I have to say, "built-in types" or POD types (however, I am not fully understand it).
Next time I will review the answer first, and after that, will ask, if needed, because there are answers, but they are extremely small and sometimes it's hard to get it.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

766 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