Template Techniques


Classes

struct  eepgwde::detail::pointerize0< B, T >
struct  eepgwde::detail::i0::dummy< int >

Functions

template<typename B, typename C>
eepgwde::detail::pointerize (C &c)
template<typename B, typename C>
eepgwde::detail::pointerize1 (C b, C e)

Detailed Description

Provide some facilities to work with templates.

pointerize is a template that helps in passing STL containers. The STL containers take copies of the objects that are inserted into them. This can cause problems with object slicing if you are downcasting. Downcasting (and using virtual functions) are the sole polymorphic mechanism, so to avoid compromising downcasting, it becomes necesssary to pass pointers to other containers, so that virtual functions can be invoked via pointers.

These templated functions provide a means to convert a container of objects to a container of pointers to objects.


Function Documentation

template<typename B, typename C>
B eepgwde::detail::pointerize ( C &  c  )  [inline]

A method to return a container of pointers to the objects in another container.

The expects T to be a derived type of B.

Parameters:
c A container of objects.
Template Parameters:
C Class of a container of objects.
B Class of a container of pointers to objects in c.
See also:
pointerize1

pointerize0

Definition at line 290 of file typing0.hpp.

template<typename B, typename C>
B eepgwde::detail::pointerize1 ( b,
e 
) [inline]

A method to return a container of pointers to objects specified by a pair of iterators.

The expects C to be the iterator for a class that has B as a base type.

Parameters:
b A begin iterator
e An end iterator
Template Parameters:
C An iterator class
B Class of a container of pointers to objects in c.
See also:
pointerize1

pointerize0

Definition at line 309 of file typing0.hpp.


Generated on Thu Feb 18 21:30:12 2010 for eleve by  doxygen 1.5.6