comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Re: Array of Unbounded_String vs Indefinite_Vectors(Natural, String)
Date: Sun, 22 Oct 2017 15:30:45 +0300
Date: 2017-10-22T15:30:45+03:00	[thread overview]
Message-ID: <osi31k$188k$1@gioia.aioe.org> (raw)
In-Reply-To: osgfbr$vfc$1@gioia.aioe.org

Victor Porton wrote:

> I need to develop an API which return a list of strings.
> 
> I have two possible design choices for the result type:
> 
> 1. type T is array(Natural range <>) of Unbounded_String;
> 
> 2. package V is new Ada.Containers.Indefinite_Vectors(Natural, String);
> 
> Which one of the two to choose?
> 
> The first has the advantage that it is a regular array not a fancy
> container. The second one has the advantage that the element type is
> String not a fancy Unbounded_String.
> 
> Please help me to make the choice!

"2" is preferred, because it is more flexible: String can be replaced with 
some another type without big code changes.

-- 
Victor Porton - http://portonvictor.org


      parent reply	other threads:[~2017-10-22 12:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-21 21:48 Array of Unbounded_String vs Indefinite_Vectors(Natural, String) Victor Porton
2017-10-22  0:51 ` Shark8
2017-10-22 10:52   ` Victor Porton
2017-10-23 16:32     ` Shark8
2017-10-23 17:30       ` Jacob Sparre Andersen
2017-11-06  4:42       ` Robert Eachus
2017-10-22 12:30 ` Victor Porton [this message]
replies disabled

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