1--  Copyright 2001-2014 Simon Wright <simon@pushface.org>
2
3--  This package is free software; you can redistribute it and/or
4--  modify it under terms of the GNU General Public License as
5--  published by the Free Software Foundation; either version 2, or
6--  (at your option) any later version. This package is distributed in
7--  the hope that it will be useful, but WITHOUT ANY WARRANTY; without
8--  even the implied warranty of MERCHANTABILITY or FITNESS FOR A
9--  PARTICULAR PURPOSE. See the GNU General Public License for more
10--  details. You should have received a copy of the GNU General Public
11--  License distributed with this package; see file COPYING.  If not,
12--  write to the Free Software Foundation, 59 Temple Place - Suite
13--  330, Boston, MA 02111-1307, USA.
14
15--  As a special exception, if other files instantiate generics from
16--  this unit, or you link this unit with other files to produce an
17--  executable, this unit does not by itself cause the resulting
18--  executable to be covered by the GNU General Public License.  This
19--  exception does not however invalidate any other reasons why the
20--  executable file might be covered by the GNU Public License.
21
22--  Implements a Shell sort of the given container in place, using the
23--  supplied comparator.
24--
25--  The instantiating Container must fully support the operation
26--
27--    function Item_At (C : Container; Index : Positive) return Item_Ptr;
28--
29--  which is normally private and whose default implementation raises
30--  Should_Have_Been_Overridden. If it's not fully supported, as is
31--  the case for hash-table-based containers (Bags, Maps, Sets),
32--  Sort_Error will be raised.
33
34generic
35   with function "<" (L, R : Item) return Boolean is <>;
36   type Container (<>) is new Containers.Container with private;
37   with function Length (C : Container) return Natural is <>;
38procedure BC.Containers.Shellsort (C : in out Container);
39pragma Preelaborate (BC.Containers.Shellsort);
40