Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    BaseArray swaps [SOLVED]

    SDK Help
    0
    2
    230
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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,

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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);  
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post