summaryrefslogtreecommitdiff
path: root/gcc/ada/a-coormu.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-coormu.adb')
-rw-r--r--gcc/ada/a-coormu.adb29
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ada/a-coormu.adb b/gcc/ada/a-coormu.adb
index b59f6f554ef..2ed14819243 100644
--- a/gcc/ada/a-coormu.adb
+++ b/gcc/ada/a-coormu.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -38,6 +38,8 @@ pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys);
with Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Set_Operations);
+with System; use type System.Address;
+
package body Ada.Containers.Ordered_Multisets is
-----------------------------
@@ -266,6 +268,20 @@ package body Ada.Containers.Ordered_Multisets is
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
-------------
-- Ceiling --
-------------
@@ -312,6 +328,17 @@ package body Ada.Containers.Ordered_Multisets is
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Set) return Set is
+ begin
+ return Target : Set do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------