View previous topic :: View next topic |
Author |
Message |
jaker49
Joined: 19 Jun 2009 Posts: 4
|
Posted: Sun Jun 21, 2009 5:39 am Post subject: Overloading = |
|
|
In C++ it is possible to define the = operator
MyClass & MyClass::operator=( const MyClass& m ) {
MyData = m.MyData;
return *this;
}
Is there an equivalent in D? |
|
Back to top |
|
|
michaelp
Joined: 27 Jul 2008 Posts: 114
|
|
Back to top |
|
|
jaker49
Joined: 19 Jun 2009 Posts: 4
|
Posted: Mon Jun 22, 2009 5:59 am Post subject: |
|
|
That was easy. Thank you.
Is there an equivalent to overloading operator<< (ostream & ).
In C++ it is
friend ostream & operator<<( ostream & os, const MyClass & Me ) {...} |
|
Back to top |
|
|
csauls
Joined: 27 Mar 2004 Posts: 278
|
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
Posted: Tue Jun 23, 2009 3:15 am Post subject: |
|
|
I think he is looking for "char[] toString()" in Object. |
|
Back to top |
|
|
|