![]() |
|
#1
|
|||
|
|||
Operator Overloading & Class implementation QuestionHello GID community... I am in need of some implementation help. As well with some operator overloading help.
I have many many sorting algorithms that I have created over the last week, and now came to a point I want to count for each one how many comparisons within the code. Easiest way to do it looks like operator overloading. I have searched up and down to find this out. I have used BOOST libraries to extensively test the sorts I have created and now I am onto this. CPP / C++ / C Code:
The question I have is, how do I count the comparisons using overloading in a class like that? Am I thinking correctly or would there be a better way to do this? Is there a way to overload the comparison operators for a templated type? |
|||
|
#2
|
||||
|
||||
Re: Operator Overloading & Class implementation QuestionQuote:
Quote:
Quote:
Quote:
|
|
#3
|
|||
|
|||
Re: Operator Overloading & Class implementation Question"Recognize that you will only be able to overload operator<() for user-defined classes, not fundamental types such as float, char, or int."
That helped me thank you. I now have created a new type with it's own overloaded operators. I will now sort using the new user defined type. Best Regards. |
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hard drive/CPU Diagnoses Issues | binarybug | Computer Hardware Forum | 1 | 22-Jan-2007 20:23 |
| Box Class, need help again :( | TransformedBG | C++ Forum | 7 | 13-Nov-2006 16:11 |
| C++ class -- Please help | vnca_1 | C++ Forum | 3 | 14-Jun-2006 13:31 |
| a tester class and then some. | postage | Java Forum | 1 | 06-May-2006 16:48 |
| Opinion on my code and a c++ class question | FlipNode | C++ Forum | 7 | 07-Feb-2006 09:15 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The