
21 Aug
2010
21 Aug
'10
10:54 p.m.
At Sat, 21 Aug 2010 18:04:37 +0100, David Irvine wrote:
This looks like a good move and I think very efficient, although I think perhaps for completeness you should declare the assignment operator private, to prevent the compiler declaring if for you.
Not just perhaps; definitely. The intent clearly appears to be that assignment should be forbidden: // don't permit id to change - don't define assignment // but copying is ok special_type(const special_type & s) : m_i(s.m_i) ; And probably the constructor should be explicit. -- Dave Abrahams BoostPro Computing http://www.boostpro.com