Need some help with constructor
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:24 UTC
Read the original article
Hit count: 332
c++
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