#include <algo.hpp>
Public Types | |
typedef ListType | list_type |
typedef ListType::value_type | full_value_type |
typedef ::s11n::type_traits< full_value_type >::type | value_type |
Public Member Functions | |
child_pointer_deep_copier (list_type &target) | |
Target list must outlive this object. | |
bool | operator() (const value_type *p) throw () |
Inserts a copy of p into this object's list and returns true. |
Designed for use with std::for_each and the like.
Assuming T is the type contained in ListType, stripped of any pointer part, then the following must hold:
push_back( T * )
.
T * t = new T( *p );
Where p is a passed to this type's operator().
ACHTUNG: This is only useful for non-polymorphic copying.
It might be interesting to note that copying monomorphic s11n::s11n_node objects this way is "pseudo-polymorphic" - the copy itself is monomorphic but the data needed to deserialize the proper type from the node is maintained.
Definition at line 352 of file algo.hpp.
|
|
|
|
|
|
|
Target list must outlive this object.
|
|
Inserts a copy of p into this object's list and returns true. Returns true if p is successfully copied. If an exception thrown while copying, this function will catch it and not modify the underlying container. In that case, false is returned. The target list takes ownership of the new copy of p. |