[Y-devel] Slider widget done

Andrew Suffield asuffield at debian.org
Wed Mar 10 22:24:08 GMT 2004


On Wed, Mar 10, 2004 at 06:42:51PM +0100, Alexandre Sauv? wrote:
> On Wed, Mar 10, 2004 at 06:19:23PM +0100, Jerome Laheurte wrote:
> > 
> > Well, I first tried with templates, but I let it go because I'm not
> > aware of a way to specify a "transformation function" in a template
> > (for instance, atol(3) in the case of integer properties).
> 
> Isn't this related to constructors in the destination class?
> 
> when you say 
> A.item_classX = B.item_classY
> 
> if classX provides a constructor which has only one argument of classY, the
> cast is IMPLICIT.

For template <typename X, typename Y> where X is not type-equivalent
to Y, then:

X a;
Y b;
a = b;

is a static cast, and therefore equivalent to:

a = static_cast<X>(b);

Static casts are allowed if there is precisely one known
conversion. There are lots of different ways to define type
conversions.

Not useful here, though.

-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  https://www.debian.org/ |
 `. `'                          |
   `-             -><-          |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://www.y-windows.org/pipermail/y-devel/attachments/20040310/a70780bf/attachment.bin


More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved