comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: When to use Bounded_String?
Date: Mon, 20 Nov 2017 06:38:43 +0100
Date: 2017-11-20T06:38:43+01:00	[thread overview]
Message-ID: <outpp0$vp3$1@dont-email.me> (raw)
In-Reply-To: <f7d2pfFctulU1@mid.individual.net>

Le 19/11/2017 à 10:55, Niklas Holsti a écrit :
> On 17-11-19 04:19 , Victor Porton wrote:
>> What is the main purpose of Bounded_String?
> 
> As I understand it, the purpose is to let a program use string variables
> of dynamically varying length, without using dynamically allocated heap
> memory. The penalty is a fixed upper bound on the length, and perhaps
> more copying of characters from one variable to another (depending on
> the implementation).
> 
No, it's not just a matter of implementation. Bounded_String are a good
fit for data types implemented as strings. A typical example is name,
address, etc. from a person's data. These are represented as strings,
you need variable length, and there is generally a maximum length
(comming f.e. from the declaration in the underlying database).

Note that each instantiation provides a different type, so you cannot
assign a name to an address.
-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr


  reply	other threads:[~2017-11-20  5:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-19  2:19 When to use Bounded_String? Victor Porton
2017-11-19  9:55 ` Niklas Holsti
2017-11-20  5:38   ` J-P. Rosen [this message]
2017-11-20  7:32     ` Niklas Holsti
2017-11-23 10:04 ` briot.emmanuel
2017-12-28 11:46   ` Vincent DIEMUNSCH
2017-12-28 12:00     ` Dmitry A. Kazakov
2017-12-28 12:29       ` Mehdi Saada
2017-12-29  0:42         ` Randy Brukardt
2017-12-29  9:11         ` Simon Wright
2017-12-28 14:28       ` vincent.diemunsch
2017-12-29  0:36         ` Randy Brukardt
2017-12-29  8:48           ` Dmitry A. Kazakov
replies disabled

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