From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Good/best way to enforce library-level instantiation a generic package
Date: Tue, 17 Mar 2020 20:03:48 -0500
Date: 2020-03-17T20:03:48-05:00 [thread overview]
Message-ID: <r4rs1l$9bu$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: r4qbs8$192$1@dont-email.me
"Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> wrote in message
news:r4qbs8$192$1@dont-email.me...
...
> You can also use Ada.Tags.Expanded_Name on a tagged type declared in the
> generic:
>
> type T is abstract tagged null record;
> Name : constant String := Ada.Tags.Expanded_Name (T);
> pragma Assert
> (Ada.Strings.Fixed.Index (Name (Name'First .. Name'Last - 2), ".") = 0,
> "Generic_Name must be instantiated at library level");
That would reject an instance in a library-level child package, which
probably isn't what the OP wants.
Randy.
next prev parent reply other threads:[~2020-03-18 1:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-16 18:51 Good/best way to enforce library-level instantiation a generic package Vincent Marciante
2020-03-17 1:21 ` Randy Brukardt
2020-03-17 10:11 ` Vincent Marciante
2020-03-17 11:21 ` Jeffrey R. Carter
2020-03-18 1:03 ` Randy Brukardt [this message]
2020-03-18 9:23 ` Jeffrey R. Carter
2020-03-20 20:37 ` Randy Brukardt
2020-03-18 10:27 ` Vincent Marciante
2020-03-17 6:29 ` briot.emmanuel
2020-03-17 10:15 ` Vincent Marciante
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox