- void* handle(void) const;\r
- void make_alias(void* handle);\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