Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /charles/src/

charles
Discussion topic

Back to topic list

CVS update: /charles/src/

Reply

Author matthewjheaney
Full name Matthew Heaney
Date 2004-04-18 16:05:05 PDT
Message User: matthewjheaney
Date: 04/04/18 16:05:05

Added:
 /charles/src/
  charles-algorithms-g​eneric_remove.adb

Log:
 initial revision

File Changes:

Directory: /charles/src/
========================

File [added]: charles-algorithms-g​eneric_remove.adb
Url: http://charles.tigri​s.org/source/browse/​charles/src/charles-​algorithms-generic_r​emove.adb?rev=1.1​&content-type=text/​vnd.viewcvs-markup
Added lines: 67
---------------
--------------------​--------------------​--------------------​------------------
-- --
-- CHARLES CONTAINER LIBRARY --
-- --
-- Copyright (C) 2001-2003 Matthew J Heaney --
-- --
-- The Charles Container Library ("Charles") is free software; you can --
-- redistribute it and/or modify it under terms of the GNU General Public --
-- License as published by the Free Software Foundation; either version 2, --
-- or (at your option) any later version. Charles is distributed in the --
-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the --
-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- See the GNU General Public License for more details. You should have --
-- received a copy of the GNU General Public License distributed with --
-- Charles; see file COPYING.TXT. If not, write to the Free Software --
-- Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- Charles is maintained by Matthew J Heaney. --
-- --
-- http://charles.tigris.org/ --
-- http://home.earthlin​k.net/~matthewjheane​y/index.html --
-- mailto:matthewjheane​y@earthlink.net --
-- --
--------------------​--------------------​--------------------​------------------

function Charles.Algorithms.G​eneric_Remove
  (First, Back : Iterator_Type) return Iterator_Type is

   I : Iterator_Type := First;
   J : Iterator_Type := I;

begin

   loop

      loop

         if J = Back then
            return I;
         end if;

         exit when not Predicate (J);

         J := Succ (J);

      end loop;

      Assign (Target => I, Source => J);

      I := Succ (I);
      J := Succ (J);

   end loop;

end Charles.Algorithms.G​eneric_Remove;









--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@char​les.tigris.org
For additional commands, e-mail: cvs-help at charles dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /charles/src/ matthewjheaney Matthew Heaney 2004-04-18 16:05:05 PDT
Messages per page: