[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: color & radio classes
From: |
John W. Eaton |
Subject: |
Re: color & radio classes |
Date: |
Fri, 1 Jun 2007 14:34:53 -0400 |
On 1-Jun-2007, Shai Ayal wrote:
| why not define
| color_property& color_property::operator = (const octave_value& val)
|
| and then do
|
| color = val
I think it is generally best to define only one operator= for a class
of the form
T& operator = (const T&)
and then define constructors for other types:
T (const U&)
...
That allows both
T t;
t = U ();
and
T (U ())
to work. If you only define specialized operator= functions, you
can't do the latter.
jwe