
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Scott Meyers Sent: Tuesday, September 12, 2006 1:09 AM To: boost-users@lists.boost.org Subject: [Boost-users] Library Interface Design
I've always been a big fan of the "don't let users create objects they can't really use" philosophy. So, in general, I don't like the idea of "empty" objects or two-phase construction. It's too easy for people to make mistakes.
[Nat] I try to design for single-phase construction myself. The aberrant use case that I've bumped into is deserialization. Intrusive serialization can preserve single-phase construction -- but what if the class designer didn't anticipate the need to serialize? I haven't yet worked with a serialization framework smart enough to consider constructor arguments. (I haven't yet worked with the Boost Serialization library, either; forgive me if this is already a solved problem.)