+#ifndef STLPLUS_COPY_FUNCTORS\r
+#define STLPLUS_COPY_FUNCTORS\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+// Author: Andy Rushton\r
+// Copyright: (c) Southampton University 1999-2004\r
+// (c) Andy Rushton 2004-2009\r
+// License: BSD License, see ../docs/license.html\r
+\r
+// The function constructor classes below are used by the smart_ptr and the\r
+// simple_ptr classes. They provide three (well ok, two) copying mechanisms.\r
+// These classes have been separated from the smart_ptr header by DJDM, as\r
+// the simple_ptr classes now also use them.\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+#include "containers_fixes.hpp"\r
+#include "exceptions.hpp"\r
+\r
+namespace stlplus\r
+{\r
+\r
+ ////////////////////////////////////////////////////////////////////////////////\r
+ // copy functors implementing the three possible copy semantics\r
+\r
+ // constructor_copy uses the copy constructor of the object - used for simple types\r
+\r
+ template <typename T>\r
+ class constructor_copy\r
+ {\r
+ public:\r
+ T* operator() (const T& from) throw()\r
+ {\r
+ return new T(from);\r
+ }\r
+ };\r
+\r
+ // clone_copy uses the clone method of the object - used for polymorphic types\r
+\r
+ template <typename T>\r
+ class clone_copy\r
+ {\r
+ public:\r
+ T* operator() (const T& from) throw()\r
+ {\r
+ return from.clone();\r
+ }\r
+ };\r
+\r
+ // no_copy throws an exception - used for types that cannot be copied\r
+\r
+ template <typename T>\r
+ class no_copy\r
+ {\r
+ public:\r
+ T* operator() (const T& from) throw(illegal_copy)\r
+ {\r
+ throw illegal_copy("no_copy functor called");\r
+ return 0;\r
+ }\r
+ };\r
+\r
+ ////////////////////////////////////////////////////////////////////////////////\r
+\r
+} // end namespace stlplus\r
+\r
+#endif\r