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

qgar::qstlCloneObject Struct Reference
[STL add-ons]

#include <qgarlib/stl.H>

List of all members.


Detailed Description

Struct designed to clone objects.

This struct is designed to clone objects, handled by a pointer, through STL algorithms. Below is a typical use of this struct:

 #include <list>
 #include <algorithm>
 #include <qgarlib/Object.H>
 #include <qgarlib/stl.H>
 
 list<Object*> myList;
 list<Object*> myCopyList;

 ...
 
 // Make a copy of the list
 transform(myList.begin(), myList.end(),
           back_inserter(myCopyList), qstlCloneObject());

For further information, see [Meyer, 2001].

Author:
Philippe Dosch (copy)
Date:
September 2, 2002 15:56
Since:
Qgar 2.1

Definition at line 140 of file stl.H.

Public Member Functions

template<typename T>
T * operator() (const T *t) const
 Duplicates a passed object using its copy constructor.


Member Function Documentation

template<typename T>
T* qgar::qstlCloneObject::operator() const T *  t  )  const [inline]
 

Duplicates a passed object using its copy constructor.

Parameters:
t object to be duplicated

Definition at line 149 of file stl.H.


The documentation for this struct was generated from the following file: