DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Thread: What is the correct way to overload an operator?

  1. #1
    Join Date
    Jul 2010
    Posts
    30

    What is the correct way to overload an operator?

    I am asking for the same class as my other thread on the event hooks. I have all the operators overloaded but there has to be a simpler way to do it. Right now I have each operator overloaded so that it can handle doing operations with all the base types, but I have a total of 31 definitions for each operator (actually 62 when you consider both the + and += operators) so that I have like:

    static BI^ operator+(BI^ , BI^);
    static BI^ operator+(BI^, int);
    static BI^ operator+(int, BI^);

    for each type (plus string and javas BigIteger types). I tried using templeates, but kept getting errors that it couldnt find a defintition to handle a BI + an int. Anyways, what is the simplest way to handle the overloading without creating a separate definition for every single base type?

  2. #2
    Join Date
    Dec 2003
    Posts
    3,366
    c++ auto conversion helps a lot.

    If you make an overload for the largest size of a type (hang on!) its valid for all the others (it may warn and gripe, but its valid).

    For example, if you need to handle adding integers of sizes 1,2,4,8 bytes (8 bytes is 64 bit which is largest MOST systems support) then you make ONE overload for the 8 byte integer, and one for the unsigned version of it as well (if needed) and that covers all the smaller cases since c++ will up-convert for you, for free.

    Same for double, float, and if you support it, 80bit. Just making it all 80bit, the compiler will upscale for free again.

    ----------------
    You probably know about template classes, but did you know you can make template, stand alone functions too? Those can be used as well, if you want to go there, there is probably a way to use this to make the code smaller and easier to handle.

    You can also make it universal, by making a union of all the possible types and passing that around instead, but if you do that you have to KNOW which type you have somehow, which means probably a class of the union + current type (1 byte to designate which of the up to 256 types it represents at this time). A hassle to do it but you only need 1 overload !

  3. #3
    Join Date
    Nov 2003
    Posts
    4,118
    Most numeric types are automatically convertible to one another (with possible truncation in some cases), and in other cases such as converting pointers to integers or user-defined objects, you can use template functions. If you have 62 possible conversions, you need to re-examine the design. It's unusual to define so many operators manually.
    Danny Kalev

  4. #4
    Join Date
    Dec 2003
    Posts
    3,366
    math is unfortunate in this regard.

    A class that handles math has to overload
    =
    +=
    -=
    /=
    *=
    +
    -
    *
    /


    and sometimes % and %=, and sometimes the bits or logicals too (^, ^=, &, &=, etc).

    This can explode, if you have to do it 3-4 times for just a few types, you can quickly have a need to handle 8 or more overloads per type, quickly reaching 30+ overloads.

    Thats just the nature of dealing with scientific/mathematical software from an object oriented approach. Its aggravating, ONCE, to write all the little functions. Its sweet FOREVER to have code that looks like the math you are doing:

    x += 5;
    y = (x*3)^2;
    etc.

    its worth the trouble in the long run. I do not know of a "clean" way around this problem, when dealing with say matrix/vectors which can be complex or real and must interface to scalars (ints and doubles) or complex scalars (complex<> class instances). I also always end up with some 50 overloaded operators when doing this sort of thing -- however I add all the overloads to ensure that my code DOES look like the original math on paper, anything else is not acceptable to me.
    Last edited by jonnin; 08-12-2010 at 11:07 AM.

  5. #5
    Join Date
    Jul 2010
    Posts
    30
    Danny, I thought that many definitions was a lot, thats why I wanted to ask, it was a pain in the butt to overload everything that way, and I thought that the compiler would do a lot of those conversions for me, but it kept giving me abiguity errors, which I just found out this morning was becuase there were too many options for the compiler to choose from. All I had to do was cut out some of the defintions then the ambiguity errors went away, too bad I didnt figure that out BEFORE I overloaded all the base types.

    So as long as I have a def for __int64, unsigned __int64, double, and java I should be good? well maybe one for the Decimal type also. One thing I did notice though, when I took away the definition for float and just left the double, when I did something like float a=3.1; mytype=a+mytype, the float value changed to some bizzarre number (like 3.9580000 something) I know doubles and floats are not exact, but it did not do that before taking away the difinition to handle floats, and I would have thought since it was promoting the type that it wouldnt loose any accuracy, btw, in the example above if I define the variable as double to start with (or leave the float def in place) it keeps the value as 3.1 no problem. So I guess the next question is, am I going to loose accuracy when I let the compiler handle the conversions?

    I thought overloading the constructor with something like BI(int); BI(unsigned int); and such would let the compiler know how to handle implicit conversions from the base types to my class type but that didnt work for me either. I allready have all the code within the class to handle conversions from just about any type to my class type (and my conversions dont loose any information since no matter what type Im coverting from its allways a promotion when converting to my class) so how do I tell the compiler how to manage implicit conversions to my class type? If I could manage that, then I would only need one definition for each operator like operator+(BI^,BI^); wouldnt I?

    And I wanted to let you guys know, I do appreciate the time youve spent walking me through these things, my project has been improving (even though the events thing is still bugging me), thanks.

  6. #6
    Join Date
    Dec 2003
    Posts
    3,366
    you do NOT lose accuracy when you upconvert, ever (go from a smaller type to a larger type, in terms of byte size of the type). I do not know what you did but the values of your float should be virtually idential to your double. Double check that (haha!). It should be something like 3.1 vs 3.0999999857 or the like, IE if you did this:
    fabs(x-y);
    the result should be NEARLY zero, x is a float, y is a double, and they are assigned the same constant (that is in a range that floats can handle, like your 3.1 example).

    You lose accruacy if you go from a large type to a smaller type OR if you cross from integers to floating point. Integers moved into a float are OK. Floats moved into an integer are truncated (lose, not round, the decimal, so 1.9 is 1 as an integer).

    Force print more digits:
    print your float with
    printf ("%1.20f 1.20f \n", float_var, double_var); to see the real values and understand the accuracy of a value.

    Yes, you should be fine with 64 bit integer and double and custom_class all defined without the smaller types.

    -------
    You should not have to "manage" implicit conversions. Let it alone (but understand the rules yourself so you know how to make it do what you want)! If you MUST do so, force casting the types is the way to do it:

    func( (double)(X)); //force x to be a double, so the overload for double will be used.
    or
    func( (unsigned int)(y)); //etc.

    That gets old, the better way is to ensure you code is doing what you want without the casts. I tried to explain this earlier or in a different thread, but what it comes down to is that if you require the casts, your code is 1) ugly and 2) risky (if you forget a cast, or someone else uses the code.... bad things or obscure bugs can happen, or it could confuse someone as to why it will not compile).

  7. #7
    Join Date
    Jul 2010
    Posts
    30
    and thats exactly why I spent the time to overload all the operators, even though I am the only one that is ever going to use this class, I like being able to treat it like any of the base classes, Ive spenta lot of time to get the functionality and the accuracy to where it is at. This project actually started out with the idea of just making the java biginteger class easier to work with, now, java is only there to hold the actual number, I dont even let java handle all of the math, I had to fully implement my own modular(&#37;) functions and exponentiation functions because java wont use negative numbers for those operations(or noninteger numbers, or complex numbers.......), in fact, as soon as I can figure out how to implement my own container for the number (and keep the speed I have now) Ill completely do away with java.

  8. #8
    Join Date
    Dec 2003
    Posts
    3,366
    Quote Originally Posted by AKRichard View Post
    and thats exactly why I spent the time to overload all the operators, even though I am the only one that is ever going to use this class, I like being able to treat it like any of the base classes, Ive spenta lot of time to get the functionality and the accuracy to where it is at. This project actually started out with the idea of just making the java biginteger class easier to work with, now, java is only there to hold the actual number, I dont even let java handle all of the math, I had to fully implement my own modular(%) functions and exponentiation functions because java wont use negative numbers for those operations(or noninteger numbers, or complex numbers.......), in fact, as soon as I can figure out how to implement my own container for the number (and keep the speed I have now) Ill completely do away with java.
    Java should never (ok, well rarely anyway) be faster than C++, at the best its a tie, with c++ almost always winning any speed contest. So you should be able to do this. The fastest way is a straight up array, of course, but that means a maximum number of digits (you have to decide the largest value you want to represent beforehand). If you need it to be more flexible, that means either unsigned char * or moving off to a vector or valarray template storage class (a little bit slower than arrays, and must be careful as their automatic memory management can become a slowdown if you do things carelessly, but powerful and clean approaches).

    By the way, boost has a big integer library, and there are some other opensource/free big int libs as well, most seem to be designed for encryption packages. I do not know where you would find a large floating point class, but likely this also is out there somewhere, I have never needed more than 80 bits.

  9. #9
    Join Date
    Jul 2010
    Posts
    30
    my class can be treated as integer, a floating point decimal representation that can handle a limitless (well for the most part) number of digits and it can be treated as a fraction representation depending on the settings of the base class. you can control how many digits to the right of the decimal place to keep, how to handle rounding, I have a full implementation for complex numbers and have all the basic math functions implemented so that you can be as accurate as youd like.

    I have the trig functions implemented, the square root and nth root, the logarithm functions (both natural and base 10) and I have the power function implemented to handle exponentiation with non integer exponents. All of this is in my implementation of a BigNumber class which is central to my math and encryption classes

    I had looked around at some of the implementations out there, but none of them had everything I was looking for, and most seemed targeted for something specific, such as encryption, but I use this class for quite a bit more than just that.

    I tried implementing this class from scratch (using an array of unsigned char) but I couldnt get the basic math functions to perform fast enough. I Believe java uses an array of signed char (they use signed magnitude representation) but for the +-*/ my implementation couldnt compete with javas speed, however, once the number gets large (over a few hundred digits) my implementation of general exponentiation and modular exponentiation are faster than javas. Right now all java does is hold the number (and I use it for the 4 basic operations +-*/ after I make the necessary changes to the number java holds, you know because java doesnt know anything about the decimal point or the denominator portion of the number if being handled as a fraction).

    Ive been working on this project for some 6 months now and its finally getting to the point that I am happy with it, except for those stupid events , which I know I should give up on, but Im not going to admit defeat lol.

    Oh, when I say that I am using java, Im not programming in java, the only thing I use the java library for is the BigInteger, I had thought about learning java but decided to concentrate on teaching myself c++ instead.

  10. #10
    Join Date
    Dec 2003
    Posts
    3,366
    well if you want to post the methods one by one, like addition, I can try to speed them up. Thats actually one of the things I am typically good at, a lot of our stuff has to run 50+ times a second and a lot of it is matrix based or computation heavy.


    At the very least, I can take a look.

  11. #11
    Join Date
    Jul 2010
    Posts
    30
    well I would appreciate that, and Ill post it as soon as I get back this morning

  12. #12
    Join Date
    Jul 2010
    Posts
    30
    the first listing is how I had it implemented when I tried writing m own container from scratch, which was when it only handled integer type values, the arrays are the _num and the are of unsigned char types, I didnt use twos complement because these are dynamic arrays and any number that was supposed to be positive but needed the high order bit in the high order byte set would require an extra element in the array (in the high order position) that would be zero so I had a bool value instead keep track of the polarity of the number and included a little addittional logic before the calculation to see if I needed to subtract the numbers instead (if negative) and what order to list them in ( for subtractionI needed the largest absolute valued number listed first).

    Anyways, as I said, this was from before I implemented the ability for the class to handle numbers as a decimal representation or as a fraction representation, which requires additional logic and sometimes some changes need to be made to the numbers before the calculation in order to line the decimal places up (or get the denominators equal to one another) which is wh I included the second listing, which is how I hve the operator implemented now. Ill explain the second one below.

    Code:
    		static BI^ operator=(BI^ val1, BI^ val2){
    
    			unsigned char carry=0;
    			unsigned int temp=0;
    			int tlength;
    			BI^ answer=gcnew BI();
    
    			if(val1->_num->Length>val2->_num->Length){
    
    				tlength=val2->_num->Length;
    				answer->_num->Resize(answer->_num,val1->_num->Length+1);
    
    			}
    
    			else{
    
    				tlength=val1->_num->Length;
    				answer->_num->Resize(answer->_num,val2->_num->Length+1);
    
    			}
    
    			for(int x=0;x<tlength;x++){
    
    				temp=val1->_num[x]+val2->_num[x]+carry;
    				answer->_num[x]=temp%256;
    				carry=temp>>8;
    
    			}
    
    			if(val1->_num->Length>tlength){
    
    				for(int x=tlength;x<val1->_num->Length;x++){
    
    					temp=val1->_num[x]+carry;
    					answer->_num[x]=temp%256;
    					carry=temp>>8;
    
    				}
    
    			}
    
    			if(val2->_num->Length>tlength){
    
    				for(int x=tlength;x<val2->_num->Length;x++){
    
    					temp=val2->_num[x]+carry;
    					answer->_num[x]=temp%256;
    					carry=temp>>8;
    
    				}
    
    			}
    
    			answer->_num[answer->_num->Length-1]=carry;
    
    			if(answer->_num[answer->_num->Length-1]==0){
    
    				answer->_num->Resize(answer->_num,answer->_num->Length-1);
    
    			}
    
    			return answer;
    
    		}
    In this implementation it starts off by checking if the instance is set to handle complex numbers, and if it is, then it checks to make sure both have the same value of I, passing that, it next checks to see how the instances are set to be treated, if as fraction, it makes sure the denominators(represented by the Remainder field) are equal before doing the final calculation. If the instance is set to be handled as a rational number, it figures out which value has more decimal places to it, then multiplies the other number by 10 raised to the difference in the decimal places (this lines up the decimal places for the final calculation), it then sets the decimal place to whichever value had more decimal places, then jumps to a couple of methods that take care of clean up work (makes sure the decimal place is set right and removes trailing zeros and such), finally, if the instances are set to be handled as integer types, it just does the calculation.

    Then only reason I mention all this is because one of the other problems I had last time I tried to build this from scratch was that it would create circular references so that I would end up with a stack overflow problem, some of the operators ended up quite long (the division and modular exponentiation were like 500 lines each in order to handle ALL the math those operators needed within that specific operator itself). It may seem like the class is doing an awfull lot, but, most of the stuff I do is math related and sometimes I want the speed of the integer type and sometimes I need the accuracy of the non-integer types.

    Im also not dead set on using unsigned char for the holder, if you think the operators would be quicker with twos complement or signed magnitude representations it just means a little bit more logic, the only thing I am not certain of in that is how do I tell (easily) if the final number was supposed to be positive or negative, I know how I did it before, but it seemed like an awfull lot of code.

    Code:
    		static BI^ operator=(BI^ val1, BI^ val2){
    					
    			BI^ answer=gcnew BI();
    			BI^ tempval1=gcnew BI(val1);
    			BI^ tempval2=gcnew BI(val2);
    
    			if(tempval1->InstanceComplex || tempval2->InstanceComplex && tempval1->I!=tempval2->I){
    
    				  String^ me="You cannot add or subtract two numbers whose value of I do not equal";
    				  String^ cap="The values of I do not equal";
    
    				  MyMath::LibWrap::MsgBox(0,me,cap,0);
    
    				  delete me;
    				  delete cap;
    
    				answer->Kill();
    				tempval1->Kill();delete tempval1;
    				tempval2->Kill();delete tempval2;
    
    				answer->_howinstanceistreated=tempval1->_howinstanceistreated;
    
    				return answer;
    
    			}
    
    			if(tempval1->_howinstanceistreated==HowToTreatClassEnum::Fractions || tempval2->_howinstanceistreated==HowToTreatClassEnum::Fractions){
    
    				if(tempval1->_howinstanceistreated!=tempval2->_howinstanceistreated){
    
    					tempval1->ConvertMe(HowToTreatClassEnum::Fractions);
    					tempval2->ConvertMe(HowToTreatClassEnum::Fractions);
    
    				}
    
    				answer->_howinstanceistreated=tempval1->_howinstanceistreated;
    
    				bool v1,v2,neg;
    
    				if(tempval1->MyNumber->compareTo(Basics::zero)<0){
    
    					tempval1->MyNumber=tempval1->MyNumber->multiply(Basics::negone);
    					v1=true;
    
    				}
    
    				else{
    
    					v1=false;
    
    				}
    
    				if(tempval2->MyNumber->compareTo(Basics::zero)<0){
    
    					tempval2->MyNumber=tempval2->MyNumber->multiply(Basics::negone);
    					v2=true;
    
    				}
    
    				else{
    
    					v2=false;
    
    				}
    
    				if(v1!=v2){
    
    					neg=true;
    
    				}
    
    				else{
    
    					neg=false;
    
    				}
    
    				if(tempval1->Remainder->compareTo(tempval2->Remainder)!=0){
    
    					tempval1->MyNumber=tempval1->MyNumber->multiply(tempval2->Remainder);
    					tempval2->MyNumber=tempval2->MyNumber->multiply(tempval1->Remainder);
    					tempval1->Remainder=tempval1->Remainder->multiply(tempval2->Remainder);
    					tempval2->Remainder=tempval1->Remainder;
    
    				}
    
    				if(v1){
    
    					tempval1->MyNumber=tempval1->MyNumber->multiply(Basics::negone);
    
    				}
    
    				if(v2){
    
    					tempval2->MyNumber=tempval2->MyNumber->multiply(Basics::negone);
    
    				}
    
    				answer->MyNumber=tempval1->MyNumber->add(tempval2->MyNumber);
    				answer->Remainder=tempval1->Remainder;
    
    				tempval2->MyNumber=answer->MyNumber->gcd(answer->Remainder);
    
    				if(tempval2->MyNumber->compareTo(Basics::one)>0){
    
    					answer->MyNumber=answer->MyNumber->divide(tempval2->MyNumber);
    					answer->Remainder=answer->Remainder->divide(tempval2->MyNumber);
    
    				}
    
    			}
    
    			else if(tempval1->_howinstanceistreated==HowToTreatClassEnum::Irrational || tempval1->_howinstanceistreated==HowToTreatClassEnum::Rational 
    				|| tempval2->_howinstanceistreated==HowToTreatClassEnum::Rational || tempval2->_howinstanceistreated==HowToTreatClassEnum::Irrational){
    
    				if(tempval1->_howinstanceistreated!=tempval2->_howinstanceistreated){
    
    					tempval1->ConvertMe(HowToTreatClassEnum::Rational);
    					tempval2->ConvertMe(HowToTreatClassEnum::Rational);
    
    				}
    
    				answer->_howinstanceistreated=tempval1->_howinstanceistreated;
    
    				if(tempval1->DecimalPlace>tempval2->DecimalPlace && tempval1->DecimalPlace>0){
    
    					answer->MyNumber=tempval2->MyNumber;
    					answer->MyNumber=answer->MyNumber->multiply(Basics::ten->pow(tempval1->DecimalPlace-tempval2->DecimalPlace));
    
    					answer->MyNumber=tempval1->MyNumber->add(answer->MyNumber);
    					answer->DecimalPlace=tempval1->DecimalPlace;
    
    				}
    
    				else if(tempval1->DecimalPlace<tempval2->DecimalPlace && tempval2->DecimalPlace>0){
    
    					answer->MyNumber=tempval1->MyNumber;
    					answer->MyNumber=answer->MyNumber->multiply(Basics::ten->pow(tempval2->DecimalPlace-tempval1->DecimalPlace));
    
    					answer->MyNumber=answer->MyNumber->add(tempval2->MyNumber);
    					answer->DecimalPlace=tempval2->DecimalPlace;
    
    				}
    
    				else{
    
    					answer->MyNumber=tempval1->MyNumber->add(tempval2->MyNumber);
    					answer->DecimalPlace=tempval1->DecimalPlace;
    
    				}
    
    				answer->RemoveTrailingZeros();
    				answer->FixDecimalPoint();
    
    			}
    
    			else{
    
    				answer->_howinstanceistreated=tempval1->_howinstanceistreated;
    
    				answer->MyNumber=tempval1->MyNumber->add(tempval2->MyNumber);
    
    			}
    
    			if(answer->InstanceComplex){
    
    				answer->I=tempval1->I;
    
    			}
    
    			tempval1->Kill();delete tempval1;
    			tempval2->Kill();delete tempval2;
    
    			return answer;
                                
                                   }

  13. #13
    Join Date
    Jul 2010
    Posts
    30
    whoops I put operator= but it is supposed to be operator+

  14. #14
    Join Date
    Dec 2003
    Posts
    3,366
    if you are going to use a class anyway, you can just have a boolean for +- as a member, no need for tons of logic to do it in binary representation.

    You do not have to use unsigned char, you can use whatever you like if you have another thought. I just said its one way to do it and possibly the simplest. Signed char, unsigned char, its all 2's complement, those are just 1 byte integers. Unsigned is still the same as 2s comp, just you never go negative (and lack the padded bit that represents sign). Its all bits and bytes, its up to YOU To make sense of them, so you can actually use unsigned char to store anything (even signed stuff) so long as YOU know what the bits mean =).

    Go ahead and post the operator + when you can. Assignment seems overly complicated to me though, it would be nice to do that all in like a single memcopy or something similar if at all possible.


    Also, about self-defense code. Its nice that you check everything and print errors, but that should be #defined out for release mode. This stuff slows code way, way down; I once had something like what you are doing where the same value was checked about 400 times a second for infinity, nan, zero, and more (because every function the value passed through did these checks). Checks that, once the code is debugged, simply could not happen... its the old time space tradeoff. Do you want to check everything in release mode, which is GOOD but SLOW, or do you want maximized performance at the cost of having to debug it in debug mode very well before using it? Consider your options.

    Elimination of pointers really, really helps speed too. Every time you have a pointer, the computer wastes a bunch of time to deal with it, often more than triple the overhead involved if you just use the stack. I am worried about this "resize" function you have, it just screams "slow".

    The closer you can make your code to like a CPU's full and half adder circuits (easily found and described on the web) the better, most likely. Just a thought -- same for division etc. Honestly, I find that its often faster to invert & multiply than to divide, if your inversion algorithm is fast. (this is true in calculus too haha, who would use the division formula for derivatives when invert+multiply is 1/10 the work). Esp when in fraction format, its really easy to invert those... !

    I do not know if its useful or not, but it may be POSSIBLE with some hackery to make the complex c++ template class work with a normal version of your class, removing the need for you to do *anything much* for the complex side of it! With luck, or proper design up front, you can eliminate the complex parts of your class entirely by doing this (???).

    ---------------
    Those are my initial thoughts on it. The pointers are problably the biggest issue for your speed right now.
    Last edited by jonnin; 08-13-2010 at 03:28 PM.

  15. #15
    Join Date
    Jul 2010
    Posts
    30
    those functions I posted were the operator+, I copy and pasted all the code, without the declaration and went back and typed it in when I noticed it, I just typed in = instead of + (I know I shouldve copied and pasted that also. the assignment operator doesnt look anthing like what I posted lol.

    #define, memcopy, I know #define is a preprocessor directive, which I am taking to mean its giving the compiler some info, but I havent even begun to get into that yet, and though Ive seen memcopy I have no idea what it does yet(still learning).

    Templates! I tried using templates in various parts of the class (overloaded operators especially) but couldnt get it to work correctly so settled for overloading everything.

    I had a thought on the handles(pointers) when I was driving around. What happens if ou create a pointer to a newly created object and then use that same pointer in an assignment to a different object, such as:

    BI^ thispointer=gcnew BI();

    thispointer=thatpointer+anotherpointer;

    My addition methods return a new instance of the class, so if I am thinking correctly the thispointer above would drop its handle to the initial reference and point to a completely different object after the addition operation. So, what happens to the initial object it was pointing at? I didnt explicitly delete it, but from my understanding in managed c++, the gc should clean it up if nothing else has a strong reference to it. Now, if I have the events enabled, the hooks into the delegates are strong references, so the gc wouldnt clean it up, but, as far as I know, I would be unable to directly reach it, and it gets even worse, I have the constructors overloaded with two copies of each one (one with a bool in the def and one without), the definition without the bool will set the event hooks when events are enabled, but the definitions with the bool never set the event hooks (and the definitions with the bool are private to the class) anyways Ive been using the contructors with the bool internally since those variables have very short life spans and they shouldnt need the events.

    Anyways, if I am thinking correctly about it now, after the addition operation, I am left with one instance I can no longer reach that is set up to use events, but the pointer is now pointing to an instance that is NOT set up for events, it was only supposed to be a short lived variable that went out of scope at the end of the +operator, but now has an indeterminate life span since it is being referenced outside of the class.

    Is my logic there correct? I used the pointers because I kept reading that they are faster than passing by value, and Ive been wanting to try setting things up to pass by value ever since Danny said that for the most part there wouldnt be a noticeable drop in performance. Besides, if I did pass by value, I wouldnt need to create those extra instances of the class internally, I had to create them when passing pointers because I did not want to change the values passed to me (I didnt want any changes to those variables reflecting back to the arguments in the calling statement).

Similar Threads

  1. Operator overload problems
    By goblet in forum C++
    Replies: 7
    Last Post: 11-16-2008, 03:36 AM
  2. Conversion Operator Issue
    By Peter_APIIT in forum C++
    Replies: 6
    Last Post: 06-26-2007, 01:05 AM
  3. Replies: 1
    Last Post: 06-11-2007, 11:02 PM
  4. Porblems with << operator overload.
    By daviar in forum C++
    Replies: 0
    Last Post: 04-30-2007, 01:28 PM
  5. subtraction operator overload
    By arnie6 in forum C++
    Replies: 2
    Last Post: 04-21-2005, 05:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center