copy constructor in private section

Discussion in 'C++' started by namburi02431, Feb 14, 2012.

  1. namburi02431

    namburi02431 New Member

    Joined:
    Feb 14, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    i my project, i have seen copy constructor is kept in private section....what are the advantages of keeping copy constructor in private seciton.....please throw your views.......
     
  2. johnBMitchell

    johnBMitchell New Member

    Joined:
    Feb 17, 2011
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    CA, USA
    Home Page:
    http://www.spinxwebdesign.com/
    Yes, main advantage of private copy constructors is that when you make your copy constructors as a private then it will not allow to copying your object to other class.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice