X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fstlplus%2Fpersistence%2Fpersistent_set.tpp;fp=src%2Fstlplus%2Fpersistence%2Fpersistent_set.tpp;h=0000000000000000000000000000000000000000;hb=5846afb00833cc72fe72422ca896d2387c712cb4;hp=007d06825fce90c9b0a3400dbbcaf82b50c32ace;hpb=a97500609dc3c1b11f9786d32bc458eb00de4c36;p=chaz%2Fyoink diff --git a/src/stlplus/persistence/persistent_set.tpp b/src/stlplus/persistence/persistent_set.tpp deleted file mode 100644 index 007d068..0000000 --- a/src/stlplus/persistence/persistent_set.tpp +++ /dev/null @@ -1,44 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// - -// Author: Andy Rushton -// Copyright: (c) Southampton University 1999-2004 -// (c) Andy Rushton 2004-2009 -// License: BSD License, see ../docs/license.html - -//////////////////////////////////////////////////////////////////////////////// -#include "persistent_int.hpp" - -namespace stlplus -{ - - //////////////////////////////////////////////////////////////////////////////// - - template - void dump_set(dump_context& context, const std::set& data, D dump_fn) - throw(persistent_dump_failed) - { - dump_unsigned(context,data.size()); - for (typename std::set::const_iterator i = data.begin(); i != data.end(); i++) - dump_fn(context,*i); - } - - template - void restore_set(restore_context& context, std::set& data, R restore_fn) - throw(persistent_restore_failed) - { - data.clear(); - unsigned size = 0; - restore_unsigned(context,size); - typename std::set::iterator i = data.begin(); - for (unsigned j = 0; j < size; j++) - { - K key; - restore_fn(context,key); - // inserting using an iterator is O(n) rather than O(n*log(n)) - i = data.insert(i, key); - } - } - - //////////////////////////////////////////////////////////////////////////////// - -} // end namespace stlplus