Boost logo

Boost :

Subject: Re: [boost] safe bool operator
From: Domagoj Saric (domagoj.saric_at_[hidden])
Date: 2010-03-04 07:41:26


"Jeffrey Hellrung" <jhellrung_at_[hidden]> wrote in message
news:4B8F777C.6000202_at_ucla.edu...
> I don't think the requirement for operator! is so bad (should certainly
> satisfy the majority of use cases, right?),

FWIW I don't remember writing one, ever... ;)

> and perhaps efficiency can be addressed by defining the
> "unspecified_bool_type" conversion in debug builds and a straight bool
> conversion in release builds for "problem" compilers...? Or perhaps some
> other preprocessor macro can direct whether to go with the type-safe version
> (default) or the efficient version (which may in fact be the same for some
> compilers)...?

But there is no need for any of that...shared_ptr already has an efficient
implementation...
I just wrapped this implementation along with one of my one (that is perhaps
slightly less 'clean' but easier on the optimizer) into a 'reusable' solution...

--
"What Huxley teaches is that in the age of advanced technology, spiritual
devastation is more likely to come from an enemy with a smiling face than from
one whose countenance exudes suspicion and hate."
Neil Postman 

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