Classes | |
struct | eepgwde::detail::pointerize0< B, T > |
struct | eepgwde::detail::i0::dummy< int > |
Functions | |
template<typename B, typename C> | |
B | eepgwde::detail::pointerize (C &c) |
template<typename B, typename C> | |
B | eepgwde::detail::pointerize1 (C b, C e) |
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.
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.
c | A container of objects. |
C | Class of a container of objects. | |
B | Class of a container of pointers to objects in c. |
Definition at line 290 of file typing0.hpp.
B eepgwde::detail::pointerize1 | ( | C | b, | |
C | 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.
b | A begin iterator | |
e | An end iterator |
C | An iterator class | |
B | Class of a container of pointers to objects in c. |
Definition at line 309 of file typing0.hpp.