BaseArray swaps [SOLVED]



  • On 29/05/2015 at 16:04, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R16 
    Platform:   Windows  ;   Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    I'm doing a sort in a method, and part of the items being sorted are BaseArrays.  Would this work as a swap of the two BaseArrays or is there a better way.

    maxon::BaseArray<LibraryCollection*>	icoll;
    icoll.CopyFrom(lii->collections, TRUE);
    lii->collections.CopyFrom(lij->collections, TRUE);
    lij->collections.CopyFrom(icoll, TRUE);
    

    Thanks,



  • On 30/05/2015 at 11:30, xxxxxxxx wrote:

    This is very inefficient solution.

    How about to use maxon::Swap ?

      
    maxon::Swap(icoll, lii->collections);  
    

Log in to reply