[xsde-users] Re: Bug?

Boris Kolpackov boris at codesynthesis.com
Thu Feb 23 11:24:54 EST 2017


Hi Laurent,

Laurent Michel <laurent1984 at gmail.com> writes:

> BUT, maybe I am fine with just pointers or references, because I saw that
> you define your sequences like this:
> 
> template <typename T>
>       class var_sequence: public sequence_base
>       {
> 
>      [...]
> 
> #ifndef XSDE_EXCEPTIONS
>         error
> #else
>         void
> #endif
>         push_back (T*);
>     }
> 
> which means you don't store the sequence elements by value but by
> reference.

Actually, push_back() will assume ownership of the passed node.


> So, as far as I understand, as long as my objects exist somewhere in
> the heap, I can add them to the sequence without using any copy
> constructor.

Right, except that you don't need to delete them (unless you also
detach the node).

Boris



More information about the xsde-users mailing list