1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    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