comp.lang.ada
 help / color / mirror / Atom feed
From: Egil H H <ehh.public@gmail.com>
Subject: Re: User defined implicit conversion
Date: Wed, 30 Oct 2019 13:39:16 -0700 (PDT)
Date: 2019-10-30T13:39:16-07:00	[thread overview]
Message-ID: <51f1445d-8b2d-43b3-a193-733395a090d2@googlegroups.com> (raw)
In-Reply-To: <d9269cae-93e5-428c-9c7c-a7a1f5679806@googlegroups.com>

On Wednesday, October 30, 2019 at 8:43:05 PM UTC+1, Alain De Vos wrote:
> Casting from one type to another is a real pain.
> Does the functionality "User defined implicit conversion" exists?
> If not are there strategies, general rules, to limit conversion to a minimum ?
> 
> We don't want as concatination :
> result := to_type_a (from_type_a (X) & from_type_a (Y)) ;
> when you could have :
> result := X & Y ;


If they are all type_a, as indicated in the example, 
you should be able to do just
result := X & Y;

Maybe you forgot to make the operator visible?
use type type_a;

  parent reply	other threads:[~2019-10-30 20:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30 19:43 User defined implicit conversion Alain De Vos
2019-10-30 19:58 ` Simon Wright
2019-10-30 20:39 ` Egil H H [this message]
2019-10-30 21:26 ` Randy Brukardt
2019-10-30 22:17   ` Dmitry A. Kazakov
2019-11-06  6:19   ` G. B.
2019-10-31 11:18 ` AdaMagica
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox