Re: [boost] New Library Proposal: dual_state

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of David Abrahams Sent: Monday, July 11, 2005 8:50 PM To: boost@lists.boost.org Subject: Re: [boost] New Library Proposal: dual_state
"Jost, Andrew" <Andrew_Jost@mentor.com> writes:
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of David Abrahams Sent: Sunday, July 10, 2005 10:23 PM To: boost@lists.boost.org Subject: Re: [boost] New Library Proposal: dual_state
Eelis van der Weegen <gmane@contacts.eelis.net> writes:
So, in conclusion, the motivation for your dual_state is very valid, but personally I think Boost.Optional is a more appropriate design.
IMO the "guaranteed object delivery" feature makes for a useful specialization of the Boost.Optional design. However, it would be nice to have both; it's not an alternative to Boost.Optional.
I agree. These are two separate ideas, each with its own utility.
There's a lot of resonance with the Boost.Parameter
library in here.
Where can I find information on Boost.Parameter?
In the CVS at libs/parameter (new docs in progress at libs/parameter/doc) and boost/parameter. An earlier version of the tutorial docs are at http://cvs.sourceforge.net/viewcvs.py/*checkout*/boost-sandbox /boost-sandbox/libs/utility/doc/named_params.html#tutorial
Thanks, I found it. What a great idea!
One additional thought occurred to me. How does Boost.Optional handle cases where object construction fails? I'm not sure how many approaches exist to the problem of failed constructors, but I think most programmers agree that constructors should rarely (if ever) be allowed to throw an exception.
No, that's approximately 180 degrees away from correct. Bjarne Stroustrup used to recommend it, and it appears that a few people still think it makes sense, but in fact throwing from constructors is a very good idea because it allows us to establish simple class invariants.
Based on several replies, my perception was obviouly outdated.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

"Jost, Andrew" <Andrew_Jost@mentor.com> writes: <snip> entire universe
of the tutorial docs are at http://cvs.sourceforge.net/viewcvs.py/*checkout*/boost-sandbox /boost-sandbox/libs/utility/doc/named_params.html#tutorial
Thanks, I found it. What a great idea!
One additional thought occurred to me. How does Boost.Optional handle
http://www.boost.org/more/discussion_policy.htm#quoting -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
David Abrahams
-
Jost, Andrew