Boost logo

Boost :

Subject: Re: [boost] [safebool] Can we generalize it and put it into utilities?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-03-30 21:44:32


Vladimir Batov wrote:
> Based on the suggestions from Steven Watanabe and Robert Stewart I've uploaded
> safebool.hpp into the Vault. It can be deployed as
> struct Foo
> { ...
> operator safebool<Foo>::type() const { return safebool<Foo>(condition); }
> };
> or operator safebool<Foo>::type() const { return safebool<Foo>::make(c); }
> or operator safebool<Foo>::type() const { return make_safebool<Foo>(c); }
> I still like the first one but the other two seemed strong contenders and I
> realize they might be marginally faster (in theory anyway).

I consider any speed differences to be highly unlikely.
IMO, you should pick one interface and stick to it.
There is no reason to provide several ways to do the
same thing when there are only minor syntactic differences.

> Documented the need, the usage and the solution.

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at