Boost logo

Boost :

Subject: Re: [boost] [review] string convert
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-05-09 10:25:17


Vladimir Batov wrote:
> > From: "Matt Chambers" <matt.chambers42_at_[hidden]>
> > ...
> > Your examples are hypocritical based on your earlier
> > argument about there not being a meaningful default value
> > for your non-defaultable types. We agreed there is no
> > meaningful default for the "to_be or not_to_be" problem, so
> > your usage here of defaulting it to to_be doesn't make
> > sense. Especially when you proceed to use the return value
> > that's invalid...
>
> Well, indeed I am such a hypocrite. :-P

Actually, no, it isn't hypocritical. There's a difference between supplying a default in a particular context and one for general use. The default_value CP Vicente suggested provides a default value for use in the context of conversions. Vladimir's I/F is based upon the idea of supplying the default at the point of call. These approaches differ from providing a default constructor that supplies a default for all contexts.

> On the serious note though I feel we are going in circles.
> We've discussed that before. Thare are, in fact, two different
> use-cases:
>
> 1. the relevant class is not DefaultConstructible;
> 2. the relevant class does not have meaningful fallback.
>
> These two cases are *separate*.

They can be separate or comingled, but must be addressed separately.

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer using std::disclaimer;
Dev Tools & Components
Susquehanna International Group, LLP http://www.sig.com

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk