CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: nuzzle

Search: Search took 0.03 seconds.

  1. Replies
    14
    Views
    4,400

    Re: Cloning an object

    Slicing only happens when an object is upcasted by value (is copied upwards in its inheritance hierarchy), like



    class Base {};
    class Derived : public Base {};
    //
    Derived d;
    Base b = d; //...
  2. Replies
    14
    Views
    4,400

    Re: Cloning an object

    When performing operations on an object it must be clear whether we're concerned with what it holds (value semantics) or where it's at (reference semantics).

    It's a profound difference. For...
  3. Replies
    14
    Views
    4,400

    Re: Cloning an object

    Usually there's no need to create transient value objects on the heap (unless they're very big and would cause the stack to overflow). This task is performed much better and faster by the stack. In...
Results 1 to 3 of 3





Click Here to Expand Forum to Full Width

Featured