Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

regina::FuncNewClonePtr< T > Struct Template Reference
[General Utility Classes]

An adaptable unary function used to create objects using the clone() method. More...

#include <memutils.h>

List of all members.

Public Types

typedef const T * argument_type
 The argument type for this unary function.
typedef T * result_type
 The return type for this unary function.

Public Member Functions

T * operator() (const T *ptr) const
 Creates a new object using the clone() method.


Detailed Description

template<class T>
struct regina::FuncNewClonePtr< T >

An adaptable unary function used to create objects using the clone() method.

This class is for use with the Standard Template Library.

Note that the template argument need not be a pointer class. If the template argument is T, this unary function will accept a pointer to T and call clone() upon the corresponding object, returning a pointer to the newly created clone of type T.

Precondition:
Type T has method T* clone() const. The declared return type may be different, but the result must be castable to T*.
Python:
Not present.


Member Typedef Documentation

template<class T>
typedef const T* regina::FuncNewClonePtr< T >::argument_type
 

The argument type for this unary function.

template<class T>
typedef T* regina::FuncNewClonePtr< T >::result_type
 

The return type for this unary function.


Member Function Documentation

template<class T>
T* regina::FuncNewClonePtr< T >::operator() const T *  ptr  )  const [inline]
 

Creates a new object using the clone() method.

Parameters:
ptr the pointer whose corresponding object should be cloned.
Returns:
the newly created clone.


The documentation for this struct was generated from the following file:
Copyright © 1999-2004, Ben Burton
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).