comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: How can I qualify the predefined logical operations
Date: 1998/07/19
Date: 1998-07-19T00:00:00+00:00	[thread overview]
Message-ID: <35B13A62.B113B73E@elca-matrix.ch> (raw)
In-Reply-To: 35AF1649.15FB@asrv01.atlas.de

Andreas Kalla wrote:

> What about this solution:
> 
>    function "And" (Left, Right: Private_Type) return Private_Type   is
> 
>      Ret_Value : Private_Type := ( others => false ) ;
> 
>    begin
> 
>         for i in Private_Type'range
>         loop
>             Ret_Value ( i ) := Left ( i ) and Right ( i ) ;
>         end loop ;
> 
>         return Ret_Value ;
> 
>    end ;

This is pretty bad because many compilers won't be able to optimize away the
loop. Using the predefined "and" gives you much better chances in terms of
efficiency, especially if the array type is packed.






  reply	other threads:[~1998-07-19  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-16  0:00 How can I qualify the predefined logical operations hoyngj
1998-07-16  0:00 ` Anonymous
1998-07-16  0:00 ` dennison
1998-07-16  0:00 ` dennison
1998-07-16  0:00 ` Tucker Taft
1998-07-16  0:00 ` hoyngj
1998-07-17  0:00   ` Robert Dewar
1998-07-17  0:00 ` Andreas Kalla
1998-07-19  0:00   ` Mats Weber [this message]
1998-07-25  0:00 ` Matthew Heaney
replies disabled

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