Unidentified and remote ad hoc members of the class



  • Question of the response https://ru.stackoverflow.com/questions/428938/%D0%90%D0%B2%D1%82%D0%BE%D0%B3%D0%B5%D0%BD%D0%B5%D1%80%D0%B8%D1%80%D1%83%D0%B5%D0%BC%D1%8B%D0%B5-%D0%BA%D0%BE%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D0%BE%D1%80%D1%8B-%D0%B8-%D0%BE%D0%BF%D0%B5%D1%80%D0%B0%D1%82%D0%BE%D1%80%D1%8B-%D0%BF%D1%80%D0%B8%D1%81%D0%B2%D0%B0%D0%B8%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F-rvalue ♪

    Coping gear is not generated if there is an operation displacement.

    Displacement? What? Displacement design or transferor? That's a few points in the answer.

    And let's say we have a displacement operation, but we made it private. The copying award is not generated. What if we do, instead of private, delete (c++11)?

    How many minimum methods should be declared deleted to prohibit any appropriations/copulation? Four?



  • Two: copy design and copying operator. If a separate movement is to be authorized, a moving designer and a transferee must be identified or declared as default

    In this case, the following conditions for the designer shall not be fulfilled ( http://en.cppreference.com/w/cpp/language/move_constructor 😞

    • there are no user-declared copy constructors
    • there are no user-declared copy assignment operators

    A for the transfer operator of the assignment http://en.cppreference.com/w/cpp/language/move_assignment 😞

    • there are no user-declared copy constructors
    • there are no user-declared copy assignment operators

    I mean, at least they just removed it, but they did. So it's fair.

    Well, for dessert, the copy designer and the copying operator:

    • http://en.cppreference.com/w/cpp/language/copy_assignment
    • http://en.cppreference.com/w/cpp/language/copy_constructor

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2