Re: Template casting operator
"Jonathan Turkanis" <technews@kanga roologic.com> wrote in message
news:bvua5m$t9f 91$1@ID-216073.news.uni-berlin.de...[color=blue]
>
> "Makhno" <root@127.0.0.1 > wrote in message
> news:bvu9lt$lk$ 1@newsg4.svr.po l.co.uk...[color=green][color=darkred]
> > > Did you try using converting constructors instead?[/color]
> >
> > Yes, worked straight away. You're right - perhaps I don't need the[/color]
> cast[color=green]
> > operator at all.
> >[color=darkred]
> > > You probably need a templated assignment operator too, if you do[/color][/color]
> this.[color=green]
> >
> > No, as
> > Vector<float> pf=pd;
> > and
> > Vector<float> pf(pd);
> > are equivalent;
> >[/color][/color]
[color=blue]
>
> I didn't suggest a templated assignement operator first because your
> example didn't require it. But if you want a general-purpose
> substitute for the conversion operator, you need it.
>[/color]
I spoke too soon. It's non needed here either. But it's not because
of copy initialization.
Jonathan
"Jonathan Turkanis" <technews@kanga roologic.com> wrote in message
news:bvua5m$t9f 91$1@ID-216073.news.uni-berlin.de...[color=blue]
>
> "Makhno" <root@127.0.0.1 > wrote in message
> news:bvu9lt$lk$ 1@newsg4.svr.po l.co.uk...[color=green][color=darkred]
> > > Did you try using converting constructors instead?[/color]
> >
> > Yes, worked straight away. You're right - perhaps I don't need the[/color]
> cast[color=green]
> > operator at all.
> >[color=darkred]
> > > You probably need a templated assignment operator too, if you do[/color][/color]
> this.[color=green]
> >
> > No, as
> > Vector<float> pf=pd;
> > and
> > Vector<float> pf(pd);
> > are equivalent;
> >[/color][/color]
[color=blue]
>
> I didn't suggest a templated assignement operator first because your
> example didn't require it. But if you want a general-purpose
> substitute for the conversion operator, you need it.
>[/color]
I spoke too soon. It's non needed here either. But it's not because
of copy initialization.
Jonathan
Comment