comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: When to use formal discrete type?
Date: Wed, 29 Nov 2017 21:04:32 +0200
Date: 2017-11-29T21:04:32+02:00	[thread overview]
Message-ID: <ovn0bv$1rto$1@gioia.aioe.org> (raw)

I am creating a generic package which accepts as a formal argument a type 
which is expected to be an enumeration type.

Should for this enumeration argument I use formal private type (is private) 
or formal discrete type (is (<>))?

I do not use features specific to discrete types such as 'First or 'Range 
attributes.

Because it easily generalizes from discrete types to arbitrary private 
types, should I do generalization?

What of (generalizing for all private types or not) the two is better:

a. for clarity of code;

b. for performance?

It there a noticeable difference in performance if I generalize?

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

             reply	other threads:[~2017-11-29 19:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 19:04 Victor Porton [this message]
2017-11-29 19:43 ` When to use formal discrete type? Shark8
2017-11-29 21:07   ` Dmitry A. Kazakov
2017-11-29 21:05 ` Randy Brukardt
replies disabled

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