]>
Dogcows Code - chaz/yoink/blob - copy_functors.hpp
68f2b21b226a0d382c324552d853859bfe697f2b
1 #ifndef STLPLUS_COPY_FUNCTORS
2 #define STLPLUS_COPY_FUNCTORS
3 ////////////////////////////////////////////////////////////////////////////////
5 // Author: Andy Rushton
6 // Copyright: (c) Southampton University 1999-2004
7 // (c) Andy Rushton 2004-2009
8 // License: BSD License, see ../docs/license.html
10 // The function constructor classes below are used by the smart_ptr and the
11 // simple_ptr classes. They provide three (well ok, two) copying mechanisms.
12 // These classes have been separated from the smart_ptr header by DJDM, as
13 // the simple_ptr classes now also use them.
15 ////////////////////////////////////////////////////////////////////////////////
16 #include "containers_fixes.hpp"
17 #include "exceptions.hpp"
22 ////////////////////////////////////////////////////////////////////////////////
23 // copy functors implementing the three possible copy semantics
25 // constructor_copy uses the copy constructor of the object - used for simple types
28 class constructor_copy
31 T
* operator() (const T
& from
) throw()
37 // clone_copy uses the clone method of the object - used for polymorphic types
43 T
* operator() (const T
& from
) throw()
49 // no_copy throws an exception - used for types that cannot be copied
55 T
* operator() (const T
& from
) throw(illegal_copy
)
57 throw illegal_copy("no_copy functor called");
62 ////////////////////////////////////////////////////////////////////////////////
64 } // end namespace stlplus
This page took 0.033173 seconds and 3 git commands to generate.