
"Jeffrey Hellrung" <jhellrung@ucla.edu> wrote in message news:4B8F777C.6000202@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