operator-overloading
Why str can't get a second parameter,when __str__ can?
I decided to use str for printing the contents of a tree in tree-like structure,using something like[详细]
2023-04-04 02:51 分类:问答Overloaded typecasts don't work
I\'ve built a little class representing a decimal number, called Complex. I want to be able to cast it to double, so here\'s my code[详细]
2023-04-04 00:35 分类:问答Assignment operator with derived type argument
class A { private: A& operator=(const A&); }; class B : public A { public: B& operator=(const A&) {[详细]
2023-04-03 21:39 分类:问答C# Overloading operator== outside the class
I have the following scenario: public class SomeClass { // Have some other data members as well public int i ;[详细]
2023-04-03 20:53 分类:问答obj1 *= obj2 VS. obj1 = obj1 * obj2 in C++
Assuming that i\'ve implemented *=, = and * operators overloading, which will you prefer to use complexity wise?[详细]
2023-04-03 07:57 分类:问答C++ boost::thread operator()() question
This is my first attempt to use boost::threads and I have a silly question. I 开发者_StackOverflow中文版call a boost:thread to use one of my template class functions. However after reading this tutori[详细]
2023-04-03 04:52 分类:问答prefix operator overloading
I\'m overloading the ++ prefixoperator using a member function. Here\'s the prototype: Test &operator++();[详细]
2023-04-02 02:01 分类:问答Implicit cast for overloaded record in Delphi as a parameter in a const array
We got rid of shortstring as part of a conversion from Delphi 7.I wanted to make it as painless as possible so we figured we could change the ShortString to some record which acted in the same way.Her[详细]
2023-04-01 21:30 分类:问答Calling a const function rather than its non-const version
I tried to wrap something similar to Qt\'s shared data pointers for my purposes, and upon testing I found out that when the const function should be called, its non-const version was chosen instead.[详细]
2023-04-01 21:08 分类:问答Assignment operator on only one of two parents
Child has two parents: Foo and Bar. Foo does not allow copying. Bar does. How can Child use Bar\'s assignment operator to copy into Bar\'s subset of Child (while leaving Foo\'s subset intact)?[详细]
2023-04-01 16:56 分类:问答