From f9bc26ce709fcd83288fb6298741dd10bda66a8b Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Thu, 30 Apr 2020 11:45:05 +1000 Subject: Preelaborate and related Pragmas --- src/directed_graphs.adb | 13 ------------- src/directed_graphs.ads | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/directed_graphs.adb b/src/directed_graphs.adb index 7641d75..3446247 100644 --- a/src/directed_graphs.adb +++ b/src/directed_graphs.adb @@ -10,19 +10,6 @@ package body Directed_Graphs is - generic - type Base_Type is private; - type Array_Type is array (Positive range <>) of Base_Type; - with package Type_Vectors is new Ada.Containers.Vectors - (Index_Type => Positive, - Element_Type => Base_Type); - function Vector_To_Array - (Input : in Type_Vectors.Vector) - return Array_Type; - - - - --------- -- "<" -- --------- diff --git a/src/directed_graphs.ads b/src/directed_graphs.ads index 826455a..db32902 100644 --- a/src/directed_graphs.ads +++ b/src/directed_graphs.ads @@ -34,6 +34,12 @@ generic package Directed_Graphs is + pragma Preelaborate; + pragma Remote_Types; + + + + subtype Extended_Node_Type is Node_Type'Base range Node_Type'Pred (Node_Type'First) .. Node_Type'Succ (Node_Type'Min (Node_Type'Base'Pred (Node_Type'Base'Last), Node_Type'Last)); @@ -64,6 +70,7 @@ package Directed_Graphs is type Graph is tagged private; type Cursor is private; + pragma Preelaborable_Initialization (Cursor); No_Element : constant Cursor; @@ -841,6 +848,19 @@ private return Cursor; + + + generic + type Base_Type is private; + type Array_Type is array (Positive range <>) of Base_Type; + with package Type_Vectors is new Ada.Containers.Vectors + (Index_Type => Positive, + Element_Type => Base_Type); + function Vector_To_Array + (Input : in Type_Vectors.Vector) + return Array_Type; + + end Directed_Graphs; -- cgit