Can I prevent future developers from making an object constructable?

Posted by mousey on Stack Overflow See other posts from Stack Overflow or by mousey
Published on 2010-05-11T01:19:02Z Indexed on 2010/05/11 1:34 UTC
Read the original article Hit count: 246

Filed under:

you have a class A, where you set ctor to be private, so a client can't call "A a;" to create obj on stack. But someday another developer add a new ctor: "A(int)" and try to call "A a(1);" inside main(). So this will create a obj on stack. How do you prevent that?

© Stack Overflow or respective owner

Related posts about c++