
"Pavel Vozenilek" <pavel_vozenilek@hotmail.com> wrote in message news:cj9ndu$8s3$1@sea.gmane.org... | | "Thorsten Ottosen" wrote: | | > | It may be also useful to provide few more | > | clone managers in library: | > | | > | - possibly the one that is able to detect dynamic type | > | at runtime and properly contruct clone, w/o need | > | for special clone support in class, | > | > hm... how would that work? | > | It is possible. Exception handlers store relation between types | and such handlers could be generated by metaprogramming. | The polymorphic_map uses this trick. Ok, I can evaluate it and make it part of a post-review once somebody submit the code. | > | - one using non-default allocator and then | > | placement new | > | > can't you do that from within | > | > T* allocate_clone( const T* ptr ) | > { return my_clone_func( ptr ); } | > | > ? | > | Yes but the clong would be separated into few pieces | instead one. ok, code please :-) | > | - one using serialization/deserialization to create | > | clone (the serialization process may for example | > | fluch internal caches or re-adjust some internal | > | structures) | > | > hm...the thing is that the clone manager controls all cloning, also when | > clones are inserted coming from other containers...seems wierd to me. | > | It is weird but should work. | I use this trick somewhere, so I put it as option. Ok, now I get it. It's like in Java where you can make a fake clone by serializing the class. br Thorsten