Sam Partington wrote:
>
> I think I agree, we want to provide as little restrictions as possible.
Dave's argument is a good one. I agree, too.
> So, now with David's suggestion, I've attached what I propose.
That won't work as you made it a nested struct so it is still different
for all instantiations. I think Dave meant to go for this one:
// bool_testable contributed by Sam Partington
-----------------------------//
template <class T, class B>
struct bool_testable;
struct safe_bool
{
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
private:
template <class T, class B> friend class bool_testable;
#endif
int x;
typedef int safe_bool::*type;
};
template <class T, class B = ::boost::detail::empty_base>
struct bool_testable : B
{
operator safe_bool::type() const
{
return !static_cast<const T&>(*this) ? 0 : &safe_bool::x;
}
};
I also think it would be fair to mention Dave as a contributor, too, as
he provided the way to reduce the overhead.
Regards, Daniel
--
Daniel Frey
aixigo AG - financial training, research and technology
Schlo�-Rahe-Stra�e 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: [EMAIL PROTECTED], web: http://www.aixigo.de
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost