Boost logo

Boost :

Subject: Re: [boost] [safebool] Can we generalize it and put it into utilities?
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-04-01 08:39:12


On Tuesday, March 31, 2009 5:06 PM
Ilya Sokolov wrote:
> Vladimir.Batov wrote:
> > Repeating safe-bool scaffolding over and over again is a
> > real nuisance. It is worse for the end users as not exactly
> > everyone is intimately familiar with the issue and the
> > safe-bool workaround. Can we generalize it and put
> > something like the following into utilities?
>
> Given a large number of known problems [1] and the
> forthcoming addition of explicit conversion operators to c++,
> it might be better to provide a macro.
>
> [1]
> http://svn.boost.org/svn/boost/trunk/boost/smart_ptr/detail/operator_bool.hpp

There are definitely portability workarounds necessary for shared_ptr, based upon Peter's work in that library. If any of those actually apply to safe_bool, they can be captured in the safe_bool class Vladimir has implemented. Of course, some of the older compilers can be ignored by this new utility.

To account for the need for operator bool() in the SunPro case, a macro would certainly be needed. However, such an operator is hardly a safe bool, so that case might simply be ignored. If support for that is included, I suggest that the macro be introduced as a means to extend support to older compilers so that those not needing such support can forego the macro.

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
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