+ Reply to Thread
Results 1 to 2 of 2

Thread: Like copy constructor, can compiler creates implicit move constructor for me?

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    49

    Like copy constructor, can compiler creates implicit move constructor for me?

    As we all know, compiler creates implicit copy constructor if I have not provided one. Is that similar to move constructor as well? Actually, can compiler creates synthesize move constructor for me if I have not provided?

  2. #2
    Junior Member
    Join Date
    Feb 2012
    Posts
    48
    Yes, depend on certain conditions, compiler can synthesize the default move constructor if:
    a. You do not provided move assignment provided for your type
    b. You do not provided copy constructor and assignment provided for your type
    c. You do not have destructor

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts