J.15.1 Pragma Inline
shall apply to one or more callable entities or generic subprograms.
Note that inline expansion is desired no matter what name
is used in the call. This allows one to request inlining for only one
of several overloaded subprograms as follows:
package IO is
procedure Put(X : in Integer);
procedure Put(X : in String);
procedure Put(X : in Character);
procedure Character_Put(X : in Character) renames Put;
with IO; use IO;
procedure Main is
I : Integer;
C : Character;
Put(C); -- Inline expansion is desired.
Put(I); -- Inline expansion is NOT desired.
Reason: This is allowed for Ada 83 compatibility.
This is only a permission as this usage was considered obsolescent even
for Ada 95.
The name in a pragma
Inline may denote more than one entity in the case of overloading. Such
to all of the denoted entities.
Incompatibilities With Ada 83
A pragma Inline cannot refer to a subprogram_body
outside of that body. The pragma can be given inside of the subprogram
body. Ada 2005 adds an Implementation Permission to allow this usage
for compatibility (and Ada 95 implementations also can use this permission),
but implementations do not have to allow such pragma
Extensions to Ada 83
Extensions to Ada 95
Wording Changes from Ada 2005
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe